Hi
I'm trying to create a transform of Lab D50 values to sRGB, using
Guy's python bindings and lcms 1.18a.
import littlecms as lcms
import numpy as np
# Set white point
D65WhitePoint = lcms.CieColour([95.047, 100.000, 108.883], colourSpace='XYZ')
# Create profile
labD50Profile = lcms.Profile(colourSpace=lcms.PT_Lab)
labD65Profile = lcms.Profile(colourSpace=lcms.PT_Lab, whitePoint=D65WhitePoint)
sRGBProfile = lcms.Profile(colourSpace=lcms.PT_RGB)
# Create transform
labD50_to_labD65_transform = lcms.Transform(labD50Profile, labD65Profile,
renderingIntent=lcms.INTENT_ABSOLUTE_COLORIMETRIC, inputDepth=0,
outputDepth=0)
labD65_to_sRGB_transform = lcms.Transform(labD65Profile, sRGBProfile,
renderingIntent=lcms.INTENT_ABSOLUTE_COLORIMETRIC, inputDepth=0,
outputDepth=8)
# Colours to be transformed
labD50Colours = np.array([
[95, 0, -2],
[55, -37, -50],
[48, 74, -3],
[89, -5, 93],
[16, 0, 0]
], dtype=np.float64)
# Transform colours
labD65Colours = labD50_to_labD65_transform.doTransform(labD50Colours)
sRGBD65Colours = labD65_to_sRGB_transform.doTransform(labD65Colours)
print sRGBD65Colours
These are the resulting colours:
[[252 236 212]
[ 0 149 191]
[220 18 106]
[253 220 0]
[ 42 39 34]]
Now, I expected something like the output from Photoshop and Bruce
Lindblooms converter:
PS CS3 Abs. col.
239, 241, 245
0, 151, 118
216, 11, 122
248, 224, 0
40, 40, 40
Bruce Lindbloom (using Bradford)
240, 241, 244
-111, 151, 218
216, 11, 123
247, 224, -40
40, 40, 40
What am I missing?
Martin Weberg
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Lcms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lcms-user