Bug 689779 - Colors: 32-bit is incorrect BUT 64-bit works fine
Summary: Colors: 32-bit is incorrect BUT 64-bit works fine
Status: NOTIFIED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Color (show other bugs)
Version: 8.62
Hardware: PC Linux
: P4 normal
Assignee: Ralph Giles
URL: http://foo2zjs.rkkda.com/tmp/gsbug/
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-01 14:58 UTC by Rick Richardson
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
compressed ppm 64 and 32 bit runs (1.87 MB, application/octet-stream)
2008-04-05 14:46 UTC, Henry Stiles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Richardson 2008-04-01 14:58:38 UTC
Refer to http://foo2zjs.rkkda.com/tmp/gsbug/ for the files...

32-bit$ foo2qpdl-wrapper -c -C10 testpage-cups.ps > bit32-gs862.prn
64-bit$ foo2qpdl-wrapper -c -C10 testpage-cups.ps > bit64-gs862.prn

$ ll *prn
-rw-rw-r-- 1 rick rick 1546323 2008-04-01 16:31 bit32-gs862.prn
-rw-rw-r-- 1 rick rick  946785 2008-04-01 16:10 bit64-gs862.prn

The colors are correct for the 64-bit machine.  The colors are NOT right
for the 32-bit machine.  Note size difference.  They are produced with 1-bit
CMYK.  Also see mono images of K plane in bit32-gs862-crop.jpg and
bit64-gs862-crop.jpg.
Comment 1 Rick Richardson 2008-04-01 15:00:31 UTC
http://foo2zjs.rkkda.com/tmp/gsbug/

-rw-rw-r-- 1 rick rick 7987221 2008-04-01 16:32 bit32-gs862-01-4.pbm
-rw-rw-r-- 1 rick rick 2764094 2008-04-01 16:35 bit32-gs862-crop.jpg
-rw-rw-r-- 1 rick rick    2979 2008-04-01 16:32 bit32-gs862.dec
-rw-rw-r-- 1 rick rick 1546323 2008-04-01 16:31 bit32-gs862.prn
-rw-rw-r-- 1 rick rick 7987221 2008-04-01 16:12 bit64-gs862-01-4.pbm
-rw-rw-r-- 1 rick rick 1851642 2008-04-01 16:27 bit64-gs862-crop.jpg
-rw-rw-r-- 1 rick rick    2744 2008-04-01 16:12 bit64-gs862.dec
-rw-rw-r-- 1 rick rick  946785 2008-04-01 16:10 bit64-gs862.prn
-rw-rw-r-- 1 rick rick   18390 2008-04-01 15:59 testpage-cups.ps
Comment 2 Henry Stiles 2008-04-01 15:15:30 UTC
It would be nice to have the actual gs command line.  From my local copy of
foo2qpdl-wrapper (ubuntu 7.10) it looks like you are using the bitcmyk device
but I don't see a "-C" option in the script.  I do have -c (color).
Comment 3 Rick Richardson 2008-04-01 15:28:32 UTC
foo2qpdl wrapper does "-c -C10" fine.  It is shell.

[SNIP]
while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt
do
        case $opt in
[SNIP]
        C)      COLORMODE="$OPTARG";;

Do this:
        $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz

Now unpack it:

    Unpack:
        $ tar zxf foo2zjs.tar.gz
        $ cd foo2zjs

Now compile and install it. The INSTALL file contains more detailed
instructions; please read it now.

    Compile:
        $ make

    Select the model number for your printer:
        $ ./getweb 300      # Get Samsung CLP-300 .ICM files
 
    Install driver, foomatic XML files, and extra files:
        $ su			OR	$ sudo make install
        # make install

    (Optional) If you use CUPS, restart the spooler:
        # make cups			OR	$ sudo make cups
Comment 4 Rick Richardson 2008-04-01 15:41:17 UTC
$ sh -x foo2qpdl-wrapper -c -C10 testpage-cups.ps >xxx
+ VERSION='$Id: foo2qpdl-wrapper.in,v 1.28 2008/03/31 10:34:41 rick Exp $'
+ PROGNAME=foo2qpdl-wrapper
++ basename foo2qpdl-wrapper
+ BASENAME=foo2qpdl-wrapper
+ PREFIX=/usr
+ SHARE=/usr/share/foo2qpdl
+
PATH=/home/rick/mono-1.1.9.2/bin:/opt/ecos/configtool-2.11:/opt/redhat/xscale-020306/H-i686-pc-linux-gnulibc2.1/bin:/opt/ecos/ecos-1.5.13/tools/bin:/home/rick/mono-1.1.9.2/bin:/opt/ecos/configtool-2.11:/opt/redhat/xscale-020306/H-i686-pc-linux-gnulibc2.1/bin:/opt/ecos/ecos-1.5.13/tools/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/rick/bin:/usr/sbin:/sbin:/opt/java/jre1.5.0_06/bin:/usr/local/bin:/sbin:/usr/sbin:/home/rick/bin:/home/rick/bin:/usr/sbin:/sbin:/opt/java/jre1.5.0_06/bin:/usr/local/bin:/usr/local/bin:/home/rick/bin:/sw/bin:/opt/local/bin
+ '[' -x /usr/bin/logger ']'
+ logger -t foo2qpdl-wrapper -p lpr.info -- 'foo2qpdl-wrapper -c' -C10
testpage-cups.ps
+ gs.foo -v
+ GSBIN=gs.foo
+ CMDLINE='-c -C10 testpage-cups.ps'
+ DEBUG=0
+ DUPLEX=1
+ COLOR=
+ COLORMODE=default
+ MODEL=0
+ QUALITY=1
+ QUALITY=wts
+ MEDIA=0
+ COPIES=1
+ PAPER=0
+ RES=1200x600
+ SOURCE=1
+ NUP=
+ CLIP_UL=
+ CLIP_LR=
+ CLIP_LOG=
+ BC=
+ AIB=
+ NOPLANES=
+ COLOR2MONO=
+ GAMMAFILE=default
+ INTENT=0
+ GSOPTS=
+ EXTRAPAD=
+ SAVETONER=
+ NUP_ORIENT=
+ GSDEV=-sDEVICE=pbmraw
+ case `$GSBIN --version` in
++ gs.foo --version
+ DEFAULTCOLORMODE=1
+ getopts '1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?' opt
+ case $opt in
+ COLOR=-c
+ getopts '1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?' opt
+ case $opt in
+ COLORMODE=10
+ getopts '1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?' opt
++ expr 3 - 1
+ shift 2
+ '[' 1 -ge 1 ']'
+ '[' '' = '' ']'
+ :
+ exec
+ case "$QUALITY" in
+ GSOPTS='-dCOLORSCREEN -dMaxBitmap=500000000 '
+ case "$MODEL" in
+ case "$MEDIA" in
+ MEDIA=0
+ case "$SOURCE" in
+ SOURCE=1
+ case "$DUPLEX" in
+ DUPLEX=1
+ case "$RES" in
+ case "$PAPER" in
+ PAPER=0
+ paper=letter
+ XDIM=10200
+ YDIM=6600
+ set_clipping 150 100 150 100
+ ulx=150
+ uly=100
+ lrx=150
+ lry=100
+ '[' '' = '' ']'
+ case "$RES" in
+ CLIP_UL='-u 150x100'
+ '[' '' = '' ']'
+ case "$RES" in
+ CLIP_LR='-l 150x100'
+ PAPERSIZE=-sPAPERSIZE=letter
+ case "$RES" in
+ DIM=10200x6600
+ case $NUP in
+ PREFILTER=cat
+ '[' 0 -ge 9 ']'
+ '[' 0 -gt 0 ']'
+ ICCTMP=/tmp/icc20539
+ '[' '' = -c ']'
+ case "$COLORMODE" in
+ case "$GAMMAFILE" in
+ GAMMAFILE=samclp300-0.icm
+ CRDBASE=/usr/share/foo2qpdl/crd
+ case "$MODEL" in
+ model=CLP-300
+ case "$RES" in
+ SCREEN=CLP-300-1200x600cms2
+ PSTOPS_OPTS=-n
+ case "$COLORMODE" in
+ AIB=-A
+ BC=-B
+ case "$GAMMAFILE" in
+ '[' -r samclp300-0.icm ']'
+ '[' -r /usr/share/foo2qpdl/icm/samclp300-0.icm ']'
+ GAMMAFILE=/usr/share/foo2qpdl/icm/samclp300-0.icm
+ create_crd
+ ICC2PS=/usr/bin/foo2zjs-icc2ps
+ '[' -x /usr/bin/foo2zjs-icc2ps ']'
+ case "$GAMMAFILE" in
+ /usr/bin/foo2zjs-icc2ps -o /usr/share/foo2qpdl/icm/samclp300-0.icm -t0
+ PSTOPS_OPTS='-n -c'
+ cat
+ '[' wts = wts ']'
+ cat
+ cat
+ case "$GAMMAFILE" in
+ GAMMAFILE='/tmp/icc20539.usecie.ps /tmp/icc20539.crd.ps /tmp/icc20539.selcrd.ps'
+ '[' -c '!=' '' -a wts = wts ']'
+ PSTOPS_OPTS='-n -c -w'
+ '[' '' '!=' -c ']'
+ '[' '' = -A -a '' = -B ']'
+ GSDEV=-sDEVICE=bitcmyk
+ '[' '' '!=' '' ']'
+ USER=
+ GS='gs.foo -q -dBATCH -dSAFER -dQUIET -dNOPAUSE'
+ foo2zjs-pstops -n -c -w
+ gs.foo -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=letter -g10200x6600
-r1200x600 -sDEVICE=bitcmyk -dCOLORSCREEN -dMaxBitmap=500000000
'-sOutputFile=|cat 1>&3' /tmp/icc20539.usecie.ps /tmp/icc20539.crd.ps
/tmp/icc20539.selcrd.ps -_
+ foo2qpdl -r1200x600 -g10200x6600 -p0 -m0 -n1 -d1 -s1 -z0 -c -u 150x100 -l
150x100 -J '' -U '' -B -A -D0
+ cat
+ '[' -x /usr/bin/logger ']'
+ logger -t foo2qpdl-wrapper -p lpr.info -- 'gs.foo -sPAPERSIZE=letter
-g10200x6600 -r1200x600 -sDEVICE=bitcmyk -dCOLORSCREEN -dMaxBitmap=500000000 
/tmp/icc20539.usecie.ps /tmp/icc20539.crd.ps /tmp/icc20539.selcrd.ps'
+ logger -t foo2qpdl-wrapper -p lpr.info -- 'foo2qpdl -r1200x600 -g10200x6600
-p0 -m0 -n1 -d1 -s1 -z0 -c -u 150x100 -l 150x100   -B -A   '
+ '[' 0 -eq 0 ']'
+ for i in crd.ps log usecie.ps selcrd.ps
+ file=/tmp/icc20539.crd.ps
+ '[' -f /tmp/icc20539.crd.ps ']'
+ rm -f /tmp/icc20539.crd.ps
+ for i in crd.ps log usecie.ps selcrd.ps
+ file=/tmp/icc20539.log
+ '[' -f /tmp/icc20539.log ']'
+ rm -f /tmp/icc20539.log
+ for i in crd.ps log usecie.ps selcrd.ps
+ file=/tmp/icc20539.usecie.ps
+ '[' -f /tmp/icc20539.usecie.ps ']'
+ rm -f /tmp/icc20539.usecie.ps
+ for i in crd.ps log usecie.ps selcrd.ps
+ file=/tmp/icc20539.selcrd.ps
+ '[' -f /tmp/icc20539.selcrd.ps ']'
+ rm -f /tmp/icc20539.selcrd.ps
+ '[' -f '' ']'
+ '[' -f '' ']'
+ exit 0
$ 

Comment 5 Henry Stiles 2008-04-03 19:10:17 UTC
Hmm, I do see sparse minor pixel differences we might want to look at but
nothing that would result in an obvious visual discrepancy.  Here is what I did
on 64 and 32 bit machines:

# create cmyk 4 bits per pixel 

../debugobj/gs -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=letter -g10200x6600
-r1200x600 -sDEVICE=bitcmyk -dCOLORSCREEN -dMaxBitmap=500000000
-sOutputFile=foo.bit ~/testpage-cups.ps -c quit

# convert to something that can be read by imagemagick (ppm)
../debugobj/gs -dBATCH -dSAFER -dQUIET -dNOPAUSE -g10200x6600 -r1200x600
-dMaxBitmap=500000000 -sDEVICE=ppmraw -sOutputFile=32.ppm -- viewcmyk.ps foo.bit
10200

# use -sOutputFile=64.ppm on 64 bit machine.

# do a pixmap diff between 32 and 64 bit output:
compare 32.ppm 64.ppm diff.ppm

# display results
display 32.ppm 64.ppm diff.ppm

This does not account for the the usecie and crd business.  Can you still
produce a problem with my simplified test on your platforms.
Comment 6 Rick Richardson 2008-04-03 19:25:22 UTC
usecie.ps and crd.ps are NEEDED to produce the outcome!  Otherwise, the colors
are not corrected at all!
Comment 7 Rick Richardson 2008-04-03 19:55:04 UTC
Where is "viewcmyk.ps"????? 
Comment 8 Henry Stiles 2008-04-03 19:57:18 UTC
viewcmyk.ps is in the "lib" directory of gs.

I think it would be best if you provided a complete gs command line and attach
all needed files to reproduce the problem.  That has always been our bug report
policy and I believe we'll save time on this particular problem if that policy
is followed.
Comment 9 Rick Richardson 2008-04-03 20:12:10 UTC
Because you can't run "foo2qpdl-wrapper"???  OK, but then there will be 4 .ps
files instead of 1 .ps file.  I'll upload them to 
http://foo2zjs.rkkda.com/tmp/gsbug/
Comment 10 Rick Richardson 2008-04-03 20:33:46 UTC
New files:

-rw-rw-r-- 1 rick rick   18631 2008-04-03 22:14 foo2qpdl-wrapper.ps
-rw-rw-r-- 1 rick rick  220420 2008-04-03 22:14 icc.crd.ps
-rw-rw-r-- 1 rick rick      56 2008-04-03 22:14 icc.selcrd.ps
-rw-rw-r-- 1 rick rick     281 2008-04-03 22:14 icc.usecie.ps

Feed them into gs in this order:
icc.usecie.ps icc.crd.ps icc.selcrd.ps foo2qpdl-wrapper.ps
Comment 11 Henry Stiles 2008-04-03 22:53:28 UTC
You didn't provide a command line, I guessed the following and saw no
significant difference in head gs:

../debugobj/gs -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=letter -g10200x6600
-r1200x600 -sDEVICE=bitcmyk -dCOLORSCREEN -dMaxBitmap=500000000
-sOutputFile=foo.bit icc.usecie.ps icc.crd.ps icc.selcrd.ps foo2qpdl-wrapper.ps
-c quit

Also the UseWTS setting is repeated in foo2qpdl-wrapper.ps for some reason
making it different than the original cups test file.
Comment 12 Rick Richardson 2008-04-05 00:41:52 UTC
Using your tools:

$ compare gs32.out.ppm gs64.out.ppm  diff.ppm
$ display/eog/gthumb  diff.ppm

$ compare -metrix PSNR gs32.out.ppm gs64.out.ppm  diff.ppm
21.3865

There are huge differences!
Comment 13 Henry Stiles 2008-04-05 14:46:13 UTC
Created attachment 3918 [details]
compressed ppm 64 and 32 bit runs

cannot reproduce attaching my 32 and 64 bit ppms.  There are minor pixel
placement issues with the font placement and nothing else.
Comment 14 Ray Johnston 2008-04-17 10:12:58 UTC
Since neither Marcos nor Henry can reproduce this, closing.
Comment 15 Rick Richardson 2008-04-17 10:30:33 UTC
Nevertheless,

$ compare gs32.out.ppm gs64.out.ppm  diff.ppm
$ display/eog/gthumb  diff.ppm

$ compare -metrix PSNR gs32.out.ppm gs64.out.ppm  diff.ppm
21.3865

!!!!!

There are huge differences in the Color Wheel.

Note the *.pbm's.
Comment 16 Henry Stiles 2008-04-17 14:11:35 UTC
We have tried to reproduce the problem on several 32 bit machines and cannot.  I
am not sure what more we can do, the likely situation, at this point, is there
is something wrong (or at least odd) with the 32 bit platform you are running
your test on.