[poppler] XYZ white point correction patch

Hal V. Engel hvengel at astound.net
Sat May 23 09:37:42 PDT 2009


On Saturday 23 May 2009 02:55:29 am Albert Astals Cid wrote:
> > According to the PDF spec. the Y white point value should always be 1.0.
> > So it might be possible to just do the correction to X and Z since this
> > would make the code slightly more efficient.  Also I now think it would
> > be better to do this in GfxCalGrayColorSpace::getXYZ() and
> > GfxLabColorSpace::setXYZ() instead of in the locations right after calls
> > to these functions.
>
> When i mean no difference i mean "diff" says the files are exactly the
> same, not that i'm not able to see a difference in them.
>
> May it be because i'm not using any color profile?
>
> Albert

It could be but the current code base defaults to sRGB as the output profile 
if one is not specified by the calling app.  So if poppler was built using 
USE_CMS then by default it should be using sRGB as the output color space for 
CIELab, Cal* and ICC objects.   

To confirm that you are using a profile you might consider modifying your code 
so that it explicitly sets the output profile by calling 
setOutputProfileName() or setOutputProfile() before opening the document.   
For additional testing I am attaching a profile intended for testing that 
causes the colors to be transformed in a way that is unmistakable because it 
transforms blues into reds and reds into blues.   Using this profile it should 
be easy to confirm that your code is actually using an output profile and also 
which parts of the rendered output are using the output profile.

No matter what output profile is being used there should be at least some 
difference in the resulting RGB values of CIELab and CalGray objects if the 
white point of the object is NOT X = Y = Z = 1.0.  I have placed printf() 
statements in the code to confirm that this is altering the XYZ values of the 
CIELab objects in the altona pdf and it is.  I have also confirmed through 
testing that this makes a visible difference in the rendered output at least 
if the white point is significantly different from X = Y =Z = 1.0.

Also I cleaned up the white point code so that the white point correction is 
now taking place in the getXYZ() functions which is where is really belongs.  
I have attached a patch with this set of changes.

Hal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BGR.icc
Type: application/x-icc
Size: 484 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090523/f25af186/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: XYZ-white-point-correction-2.patch
Type: text/x-patch
Size: 2692 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090523/f25af186/attachment-0003.bin 


More information about the poppler mailing list