Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## lcms-user

 [Lcms-user] Floating point equality comparisons From: Ethan Hansen - 2009-10-17 05:39:34 ```Several of the conversion routines in cmspcs.c perform explicit comparisons of double values to 0. Depending on the compiler used and the optimization parameters, these comparisons can be unreliable. A floating point number may not be *exactly* 0 - or any other specific number for that matter - although that was the intent of the program and/or programmer. Suggested changes: 26a27,28 > #include > 183c185 < if (xyz -> X == 0 && xyz -> Y == 0 && xyz -> Z == 0) --- > if (fabs(xyz -> X) <= DBL_EPSILON && fabs(xyz -> Y) <= DBL_EPSILON && fabs(xyz -> Z) <= DBL_EPSILON) 296c298 < if (L==0.0) { --- > if (fabs(L) <= DBL_EPSILON) { 480c482 < if (a == 0 && b == 0) --- > if (fabs(a) <= DBL_EPSILON && fabs(b) <= DBL_EPSILON) ```
 Re: [Lcms-user] Floating point equality comparisons From: Glenn Randers-Pehrson - 2009-10-17 12:02:41 ```I agree. I would probably use a macro: #define LCMS_EQ(a,b) (fabs((double)(a) - (double)(b)) <= DBL_EPSILON) if (LCMS_EQ(xyz->X, 0) && LCMS_EQ(xyz->Y, 0) && LCMS_EQ(xyz->Z, 0)) { ... } if (LCMS_EQ(L, 0.0)) { ... } or, if the test is always against 0: #define LCMS_EQ_ZERO(a) (fabs((double(a)) <= DBL_EPSILON) If (LCMS_EQ_ZERO(xyz->X) && LCMS_EQ_ZERO(xyz->Y) && LCMS_EQ_ZERO(xyz->Z)) { ... } if (LCMS_EQ_ZERO(L) { ... } Glenn On Sat, Oct 17, 2009 at 1:39 AM, Ethan Hansen wrote: > Several of the conversion routines in cmspcs.c perform explicit comparisons > of double values to 0. Depending on the compiler used and the optimization > parameters, these comparisons can be unreliable. A floating point number may > not be *exactly* 0 - or any other specific number for that matter - although > that was the intent of the program and/or programmer. > > > > Suggested changes: > > 26a27,28 >> #include >> > > 183c185 > < if (xyz -> X == 0 && xyz -> Y == 0 && xyz -> Z == 0) > --- >> if (fabs(xyz -> X) <= DBL_EPSILON && fabs(xyz -> Y) <= DBL_EPSILON > && fabs(xyz -> Z) <= DBL_EPSILON) > > 296c298 > < if (L==0.0) { > --- >> if (fabs(L) <= DBL_EPSILON) { ```
 [Lcms-user] Melding several profiles together From: Glenn Wilton - 2009-10-31 20:58:26 ```Ive got a challenge I have a large format printer printing 6 colours. The RIP is using a 6 colour output profile and assumes Adobe1998 as the input RGB profile for RGB colours. However I dont have the ability to create 6 colour profiles so to get better matches I have created RGB profiles for specefic media through the RIP using relative colourimetric rendering intents. (Print RGB charts and create a profile) This however requires that I convert any file to print to the specefic Printer RGB profile in Photoshop, However I do get very good results turning on Black Point compensation. For example the workflow for an Adobe1998 image is Adobe1998 > RCM+BPC > PrinterRGB > [RIP assumes Adobe1998 > RCM > Device 6 Colour ] Using this procecess I see the deltaE improve from around 4-5 to 1-2 for in gamut colours. What I could like to do is to use the PrinterRGB profile to UPDATE the A2B table of the 6 colour ICC profile. In effect making it more accurate - I could even hard-wire in PBC Im thinking this would involve creating a transform PrinterRGB > Adobe1998 > Device. To update the profile I would calculate the Device colour based on a 33x33x33 sample of the PrinterRGB PCS (Using LabD50?) then write the resulting colour back into on of the output profiles intents. i,e L50,a0,b0 = Device 1,2,3,4,5,6 then write those value unto the Device profiles LUT I could then bypass the steps in Photoshop and just print through the RIP with improved colour I think this could be done my making transforms however it seams a lot more accurate just to use LCMS to read the LUTs directly? Perhaps create a proofing transform and then read the resulting LUT in LCMS. I would appreciate some advice on A) Is there a solution that already exists for this? B) What steps would I need to do in LCMS to get this working? C) Am Im missing anyting? I beleive this is possible, while the conversion from Source RGB to Device Colour is over multiple profiles the path is static and pre-built. Thanks Glenn ```
 Re: [Lcms-user] Melding several profiles together From: - 2009-11-01 16:23:43 ```Hi Glenn, > I have a large format printer printing 6 colours. The RIP is using a 6 > colour output profile and assumes Adobe1998 as the input RGB profile for > RGB colours. However I dont have the ability to create 6 colour profiles > so to get better matches I have created RGB profiles for specefic media > through the RIP using relative colourimetric rendering intents. (Print > RGB charts and create a profile) Humm... The targets are RGB? How do you print the targets? Do you print the targets using normal workflow? In such case you would be profiling the AdobeRGB path, which is not necessary a bad idea. > This however requires that I convert any file to print to the specefic > Printer RGB profile in Photoshop, Do you mean the RGB profiles you created on top of the AdobeRGB path? > However I do get very good results > turning on Black Point compensation. For example the workflow for an > Adobe1998 image is Adobe1998 > RCM+BPC > PrinterRGB > [RIP assumes > Adobe1998 > RCM > Device 6 Colour ] Ok, I see, you basically are profiling the AdobeRGB path. Well, as said this is not a bad idea, because some printers (HP DesignJet, for example) does a special "perceptual" mapping for sRGB and aRGB paths. This mapping is close to colorimetric inside printer's gamut but colors are moved "perceptually" in gamut boundaries. Profiling that path gives you more colorimetric accuracy, but undoes the nice gamut mapping the colormap has. > Using this procecess I see the deltaE improve from around 4-5 to 1-2 for > in gamut colours. That's a big improvement. At that point I would also check the plot-to-plot repeatibility, just to make sure those 1-2 dE are stable. Most vendors have to face printer-to printer repeteability, so 4-5 maybe are not such bad for a generic printer. > What I could like to do is to use the PrinterRGB profile to UPDATE the > A2B table of the 6 colour ICC profile. In effect making it more accurate > [...] You may use icclink to do the trick. Please note the obtained profile would be a crafted output profile with just one intent and no proofing capabilities. icclink -x -t1 -b -o aRGBto6.icc *Lab PrinterRGB.icc AdobeRGB1998.icc 6inks.icc You would need to use a different PrinterRGB.icc for each media, and the gamut is limited to AdobeRGB (I guess this is not an issue). Otherwise it should work. Regards Marti ```