[gs-devel] rounding patch regressions

L. Peter Deutsch ghost at aladdin.com
Wed May 15 16:46:13 PDT 2002


I've now analyzed the CIE output at some length.  My current conclusion is
that the "regression" occurred because the previous output is wrong and the
current output is correct.

The image I've been using for analysis is the 8-bit image from the 148-03
panel on the Genoa test.  Here is the code I just ran, which draws a larger
image to make it easier to see what happens to the individual source pixels.

%---------------- begin PostScript

/CIE_rgb [ /CIEBasedABC <<
/DecodeLMN [{1 0.45 div exp} bind dup dup]
/MatrixLMN
 [0.4124 0.2126 0.0193 0.3576 0.7152 0.1192 0.1805 0.0722 0.9505]
/WhitePoint [0.9505 1 1.0890] >> ] def
gsave
  CIE_rgb setcolorspace
  200 200 translate
  72 3 scale
	4 4 scale
  /bps 8 def
  /clr 3 def
  /h 2 def
  1 1 32 { /w exch def
  <<
    /ImageType 1
    /Width w
    /Height h
    /ImageMatrix [w 0 0 h w 2 div 0]
    /MultipleDataSources false
    /DataSource
      [ w clr mul bps mul 7 add 8 idiv string
        0 1 2 index length 1 sub
        {1 index exch dup dup 3 bitshift or 16#FF and put} for ] cvx bind
	dup ===
    /BitsPerComponent bps
    /Decode [0 1 0 1 0 1]
    /Interpolate false
 >> image
    0 1 translate
  } for
grestore
showpage

%---------------- end PostScript

I ran this on the screen with

	gs gs -sDEVICE=x11mono t.regress.ps

Sure enough, the "black" section around the left and bottom sides of the
image is not pure black.  But it shouldn't be.  The input pixel value is not
(0,0,0), but (0,9,18), as seen in the console output produced by the ===.

In the course of getting to this point, I corrected a couple of remaining
minor numerical inaccuracies in the code, but they only affected a couple of
pixels in the output.  I will check these in now.

I'm not sure how to proceed.  I guess I would like to see more persuasive
evidence that the current output is incorrect, rather than merely different.
Alternatively, I'd be very happy if you (Raph) agreed that the current
output is (more) correct.

				Thanks -

L. Peter Deutsch     |    Aladdin Enterprises   |  203 Santa Margarita Ave.
ghost at aladdin.com    |  http://www.aladdin.com  |  Menlo Park, CA 94025

   No government censorship of software!  Oppose the CBDTPA!  www.eff.org



More information about the gs-devel mailing list