Bug 687020 - pdfwrite: color distortions with high level colors
Summary: pdfwrite: color distortions with high level colors
Status: RESOLVED DUPLICATE of bug 687146
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: master
Hardware: PC Windows XP
: P2 normal
Assignee: Dan Coby
URL:
Keywords:
Depends on: 687146
Blocks:
  Show dependency tree
 
Reported: 2003-08-28 12:58 UTC by Igor Melichev
Modified: 2007-12-13 12:55 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
cian.zip (1.93 KB, application/octet-stream)
2003-09-08 05:14 UTC, Igor Melichev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Melichev 2003-08-28 12:58:28 UTC
After the 28/08/2003 patch few tests convert to PDF with significantly 
different colors :

Testform.v1.0.2.pdf
Fixed_Original.pdf 
0.pdf    (yellow background)    
MagicEye.pdf    (yellow background)
Comment 1 Igor Melichev 2003-09-02 15:43:30 UTC
Here is a reference to the mentioned patch :
http://www.ghostscript.com/pipermail/gs-cvs/2003-August/003560.html
Comment 2 Igor Melichev 2003-09-08 05:14:59 UTC
Created attachment 277 [details]
cian.zip

Attaching a simple test that displays the cyan problem.
PDF files are made with gs8_00 and the current CVS HEAD.
Acrobat Reader renders it differently. It paints "0 1 1 rg" and "1 0 0 0 k"
with different colors.
Comment 3 Dan Coby 2003-11-20 20:06:21 UTC
Fix for 687020 and 687146.  The pdfwrite device is incorrectly converting
CalRGB color spaces into ICC color spaces.  Fix #1.

Details:

As Raph pointed out in the Wednesday's support call, there are actually
two problems.

1.  We were not correctly recognizing that we can use a CalRGB color space
for the output.  This patch corrects this problem.  One of the tests in
that process was assuming an incorrect ordering to the transforms.  This
fix corrects this problem.

2.  The ICC color space which is being created is not equivalent to the
original CalRGB color space.  This results in differing colors between
the original file and the output PDF file.  This problem is still open.

Note:  I am leaving these bug reports still open since problem 2 is still
open.


Dan


Index: src/gdevpdfc.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdfc.c,v
retrieving revision 1.41
diff -u -d -r1.41 gdevpdfc.c
--- src/gdevpdfc.c      11 Nov 2003 11:23:17 -0000      1.41
+++ src/gdevpdfc.c      21 Nov 2003 01:42:17 -0000
@@ -144,21 +144,22 @@
 private cie_cache_one_step_t
 cie_cached_abc_is_one_step(const gs_cie_abc *pcie, const gs_matrix3 **ppmat)
 {
-    /* The order of steps is DecodeLMN, MatrixLMN, DecodeABC, MatrixABC. */
-    if (CIE_CACHE3_IS_IDENTITY(pcie->caches.DecodeABC.caches)) {
+    /* The order of steps is, DecodeABC, MatrixABC, DecodeLMN, MatrixLMN. */
+
+    if (CIE_CACHE3_IS_IDENTITY(pcie->common.caches.DecodeLMN)) {
        if (pcie->MatrixABC.is_identity) {
            *ppmat = &pcie->common.MatrixLMN;
-           return ONE_STEP_LMN;
+           return ONE_STEP_ABC;
        }
        if (pcie->common.MatrixLMN.is_identity) {
            *ppmat = &pcie->MatrixABC;
-           return ONE_STEP_LMN;
+           return ONE_STEP_ABC;
        }
     }
-    if (CIE_CACHE3_IS_IDENTITY(pcie->common.caches.DecodeLMN)) {
+    if (CIE_CACHE3_IS_IDENTITY(pcie->caches.DecodeABC.caches)) {
        if (pcie->MatrixABC.is_identity) {
            *ppmat = &pcie->common.MatrixLMN;
-           return ONE_STEP_ABC;
+           return ONE_STEP_LMN;
        }
     }
     return ONE_STEP_NOT;
Comment 4 Raph Levien 2004-06-18 10:35:52 UTC
The one remaining issue seems to be the same as bug 687416, conversion of CalRGB
color spaces, likely clipping wrt the white point. Therefore closing as dup.

*** This bug has been marked as a duplicate of 687146 ***