[poppler] XYZ white point correction patch

Albert Astals Cid aacid at kde.org
Mon Jun 22 15:22:17 PDT 2009


A Dissabte, 23 de maig de 2009, Hal V. Engel va escriure:
> 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.

Ok, i've tested the patch and yes, i need to load a displayProfile, otherwise 
it seems to do nothing, the problem is that the differences i see are so minor 
i can't say if it is correct with the patch or without it.

Do you have other PDF that shows a more visible difference?

Koji is that inside your area of expertice and can say yay/nay to the patch?

Anyone else?

Albert

>
> Hal



More information about the poppler mailing list