1. Robert Kern
  2. python-lcms

Commits

Robert Kern  committed 16a2352

Add example script for testing.

  • Participants
  • Parent commits 730a3b8
  • Branches default

Comments (0)

Files changed (1)

File example.py

View file
  • Ignore whitespace
+from numpy import *
+from scipy.sandbox import image
+
+import lcms
+
+r, g, b = mgrid[0.:1:17j, 0.:1:17j, 0.:1:17j]
+srgb_image = column_stack([r.flat, g.flat, b.flat])
+scipy_xyz_image = image.rgb2xyz(image.rgbp2rgb(srgb_image))
+
+xyz = lcms.ICCProfile()
+xyz.xyz_profile()
+srgb = lcms.ICCProfile()
+srgb.srgb_profile()
+xform = lcms.Transform()
+xform.between_profiles(srgb, xyz, lcms.formats.rgb, lcms.formats.xyz)
+
+lcms_xyz_image = xform.do_transform(srgb_image)
+
+
+#### EOF #######################################################################