Modifying a PDF file by specifying an unusual white point (e.g. [.4 1 .4]) in a CalGray, CalRGB or Lab color space makes colors come out completely wrong in Ghostview, whereas in Acrobat Reader nothing changes. I believe this is due to white point scaling; in my own PDF color handling code, everything looks like it does in Acrobat when I scale all XYZ values by the white point, so that white = (1,1,1). For CalGray and Lab spaces, this means omitting the multiplication by the white point required in the PDF spec. For CalRGB, it means scaling the rows of the matrix by the white point components. I have sample files to demonstrate the problem, but I don't know how to submit them here.
Created attachment 13 [details] example with unusual white point in a CalGray color space
Created attachment 14 [details] example with unusual white point in a CalRGB color space
Created attachment 15 [details] example with unusual white point in a Lab color space
I now found a related bug: http://bugs.ghostscript.com/show_bug.cgi?id=650802 This may well be the same problem. I couldn't find the sample file mentioned in that bug report (presumably because the bug it was attached to has been closed), but I think the sample files I've uploaded demonstrate the problem more drastically due to the unusual white points.
Assigning to Dan.
In the case of CalRGB and Lab color space, the bug is fixed. I can reproduce all the problems with gs7.00 but, with the current cvs head, only CalGray makes incorrect output while CalRGB and Lab make good output.
The fix is very simple. We just need to follow PDF spec and use correct MatrixA in the CIEBasedA color space derived from CalGray. The patch is attached.
Created attachment 139 [details] CalGray patch
The patch is committed to HEAD branch.