From: Ignacio Ruiz-de-C. <ign...@si...> - 2009-11-22 23:35:36
|
Martin: > I'm trying to create a transform of Lab D50 values to sRGB, using > Guy's python bindings and lcms 1.18a. I wonder why you need to go through the D65 space... instead of creating a single transform Try this import littlecms as lcms import numpy as np labD50Profile = lcms.Profile(colourSpace=lcms.PT_Lab) sRGBProfile = lcms.Profile(colourSpace=lcms.PT_RGB) labD50_to_sRGB_transform = lcms.Transform(labD50Profile, sRGBProfile, renderingIntent=lcms.INTENT_ABSOLUTE_COLORIMETRIC, inputDepth=0, outputDepth=8) labD50Colours = np.array([ [95, 0, -2], [55, -37, -50], [48, 74, -3],[89, -5, 93]], dtype=np.float64) sRGBColours = labD50_to_sRGB_transform.doTransform(labD50Colours) print sRGBColours and you will obtain [[240 240 244], [ 0 151 218] , [217 23 122], [252 222 6]] which is close enought (+/- 1 count) to yours expected values [239,241,245], [0,151,218], [216,11,122], [248,224,0] Ignacio -- ______________________________________________________________ Ignacio Ruiz de Conejo Senior Imaging Researcher Tel. : +61 28875 9682 e-mail: ign...@si... ______________________________________________________________ |