Bug 691870 - Difference in banded versus banded rendering
Summary: Difference in banded versus banded rendering
Status: RESOLVED FIXED
Alias: None
Product: GhostPCL
Classification: Unclassified
Component: PCL raster (show other bugs)
Version: master
Hardware: PC Windows 7
: P4 normal
Assignee: Henry Stiles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-06 17:50 UTC by Michael Vrhel
Modified: 2011-04-01 22:59 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
screen_shot (221.44 KB, image/png)
2011-01-06 17:50 UTC, Michael Vrhel
Details
simple example (199 bytes, application/octet-stream)
2011-02-22 03:47 UTC, Henry Stiles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Vrhel 2011-01-06 17:50:54 UTC
Created attachment 7094 [details]
screen_shot

The file tests_private/xl/pcl6cet3.0/C420.bin page 13 has a difference when rendered with and without banding.  The colors in the gradient are different.  Attaching a png comparison.
Comment 1 Henry Stiles 2011-02-22 03:47:41 UTC
Created attachment 7272 [details]
simple example

Yes without banding the color transformation is recognized as "identity" and in the banding case it is not.  In the code we are using different branches of this logic depending on banding:

    if (icc_link->is_identity) {
        psrc_temp = &(psrc[0]);
    } else {
        /* Transform the color */
        psrc_temp = &(psrc_cm[0]);
        gscms_transform_color(icc_link, psrc, psrc_temp, 2, NULL);
Comment 2 Henry Stiles 2011-02-23 20:21:22 UTC
Below is a "fix" for the problem.  As it turns out the non-banding code never installs the ICC procedures, the high level image code does this for all images, so banding used icc and non banding used device rgb.  Is I read the ICC code it would probably complete the initialization of the color space if "setcolorspace" were called.  PCL and XL can't do that for image color spaces. 

As I said before,  this business of initializing the color space members here is not ideal. Perhaps the routines gx_install_Device[Gray|RGB]and friends could could be made public and we could call those routines from this code, I believe that would set all the colorspace members we need.

Index: pxgstate.c
===================================================================
--- pxgstate.c	(revision 12196)
+++ pxgstate.c	(working copy)
@@ -28,6 +28,7 @@
 #include "gscoord.h"
 #include "gxcspace.h"			/* must precede gscolor2.h */
 #include "gscie.h"
+#include "gsicc.h"
 #include "gsicc_manage.h"
 #include "gsimage.h"
 #include "gspath.h"
@@ -333,6 +334,7 @@
 	pbase_pcs = gs_cspace_new_DeviceGray(pgs->memory);
 #ifdef ICCBRANCH
         pbase_pcs->cmm_icc_profile_data = pgs->icc_manager->default_gray;
+        pbase_pcs->type = &gs_color_space_type_ICC;
         rc_increment(pbase_pcs->cmm_icc_profile_data);
 #endif
 	break;
@@ -340,6 +342,7 @@
         pbase_pcs = gs_cspace_new_DeviceRGB(pgs->memory);
 #ifdef ICCBRANCH
         pbase_pcs->cmm_icc_profile_data = pgs->icc_manager->default_rgb;
+        pbase_pcs->type = &gs_color_space_type_ICC;
         rc_increment(pbase_pcs->cmm_icc_profile_data);
 #endif
         break;
@@ -351,6 +354,7 @@
         cie_space = true;
 #ifdef ICCBRANCH
         pbase_pcs->cmm_icc_profile_data = pgs->icc_manager->default_rgb;
+        pbase_pcs->type = &gs_color_space_type_ICC;
         rc_increment(pbase_pcs->cmm_icc_profile_data);
 #endif
 	break;
Comment 3 Henry Stiles 2011-02-24 23:14:11 UTC
We need to study the performance of enabling the color conversion code before integrating the patch above:

For example using a sample customer performance file 19_PCL6_A4_PictureSelection_26p_600dpi.xl


with the patch:

time ./pcl6 -sDEVICE=pbmraw -o /dev/null -r600 19_PCL6_A4_PictureSelection_26p_600dpi.xl

0m57.345s

without:

 time ./pcl6 -sDEVICE=pbmraw -o /dev/null -r600 19_PCL6_A4_PictureSelection_26p_600dpi.xl

0m46.048s
Comment 4 Henry Stiles 2011-04-01 22:59:52 UTC
Fixed in 12344.