[ 
https://issues.apache.org/jira/browse/PDFBOX-6260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18114885#comment-18114885
 ] 

valery commented on PDFBOX-6260:
--------------------------------

Claude's conclusion:
Adobe also renders that box as blue (not purple), so the old hack was not 
actually correct there either — it was coincidentally plausible-looking but 
wrong. Current fix moved it in the right direction (blue, matching Adobe) but 
not all the way (Adobe's blue is apparently less oversaturated, and this 
render's product-photo cyan cast suggests a real, systematic hue/saturation 
shift, not just a rounding difference).

Root cause, from reading the actual conversion code 
(PDCIEDictionaryBasedColorSpace.convXYZtoRGB): it clamps negative XYZ to zero 
and feeds the result straight into Java's 
ColorSpace.getInstance(CS_CIEXYZ).toRGB(...) — with no chromatic adaptation 
from the CalRGB dictionary's own declared whitepoint to whatever reference 
white Java's CIEXYZ conversion actually assumes (D50, the standard ICC PCS 
illuminant). That omission exists for CalRGB, CalGray, and Lab alike, and it's 
invisible when a file's whitepoint happens to be close to D50 or D65 — which is 
probably why the original PDFBOX-5079 fixture (D50 whitepoint) rendered 
correctly by luck — but it becomes very visible for a whitepoint as extreme as 
this one (0.55 vs. D50's 0.96).

So this isn't really a "PDFBOX-6260 edge case" bug — it's a pre-existing gap 
(missing chromatic adaptation) in the whole CalRGB/CalGray/Lab calibration path 
that  D65-tolerance fix simply exposed by routing more files through real 
calibration. An earlier "plausibility guard" idea would be the wrong direction 
now — it'd suppress a genuine improvement (purple→blue) to hide a different, 
deeper problem.

I want to state right away that this conclusion might be incorrect. However, it 
sounds very plausible. You can verify the result yourself.
[~tilman], now the changes only in [^PDCIEDictionaryBasedColorSpace.java]. To 
fix all cases with the colorspaces more changes needed.

> CalRGB color regression
> -----------------------
>
>                 Key: PDFBOX-6260
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6260
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.37, 3.0.8 PDFBox
>            Reporter: Tilman Hausherr
>            Priority: Minor
>              Labels: CalRGB
>         Attachments: PDCIEDictionaryBasedColorSpace.java, 
> gs-bugzilla686749-CalRGB-reduced.pdf
>
>
> This is about this "unrealistic" CalRGB file of this GS issue
> https://bugs.ghostscript.com/show_bug.cgi?id=686749
> Rendering has different colors since PDFBOX-5079.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to