Re: [Lcms-user] How does a transformation work
An ICC-based CMM for color management
Brought to you by:
mm2
From: <mar...@li...> - 2023-12-29 14:41:43
|
Hi, >From your explanation, it seems to me that the transformation you want has nothing to do with color management. You know nothing about the L* of your grayscale and need only some scaling. I would rather use simple math in this case: Gray_out = (Gray_in * 40) /51 + 40; You could just use a for() loop. This is going to be faster that using any color management routines. Regards Marti Maria The LittleCMS Project https://www.littlecms.com > -----Original Message----- > From: flap <fb...@oh...> > Sent: Friday, December 29, 2023 12:06 PM > To: lcm...@li... > Subject: [Lcms-user] How does a transformation work > > Hi list, > > what I want: an 8 bit grey-scale output for my printer, where the input dot > values (0 … 255) are scaled and limited to values of 40 … 240 (…just an > example). > > So I created a simple test input data (256 elements of unsigned char) with a > linear ramp from 0 (at index 0) … 255 (at index 255). > > And I created an array with 4096 short entries beginning with 40 (* 256 for > unsigned short) and ramp up linear to 240 (* 256 for unsigned short) and feed > it into cmsBuildTabulatedToneCurve16() and cmsCreateGrayProfile() with > cmsD50_xyY() as its whitepoint (for the output profile). > > For the input profile I used cmsBuildGamma() with a value of 1.0 and > cmsCreateGrayProfile() with cmsD50_xyY(). > > After creating the transformation with cmsCreateTransform() with > input/output types both TYPE_GRAY_8 and an intent of INTENT_PERCEPTUAL > and applying this transformation with cmsDoTransformLineStride () to my > simple input data, the output result is still almost linear from 0 to 255 and not > limited to 40 … 240. > > So, I think I'm using the tone curves in a wrong way. But where is my mistake? > > Cheers, > Jürgen > > > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |