[comp.lang.postscript] PostScript setscreen quantization

rokicki@neon.Stanford.EDU (Tomas G. Rokicki) (03/16/91)

The PostScript setscreen operator works by `tiling the plane' with a
rectangular tile filled with threshold values from the spot function.
Thus, to figure out how the different values are quantized, simply
convert them to rectangular coordinates (from polar), round then, and
convert them back.  Given an lpi and an angle, we have

   x = round(resolution / lpi * cos(angle))
   y = round(resolution / lpi * sin(angle))
   real-angle = arctan(y, x)
   real-lpi = resolution / sqrt(x * x + y * y)

So, for the most common case, at 300 dpi, 60 lpi, 45 degrees, we get

   x = round(5 * sqrt(.5)) = 4
   y = round(5 * sqrt(.5)) = 4
   real-angle = arctan(4, 4) = 1
   real-lpi = 300 / sqrt(32) = 53

You can do the math for the Linotronic.

The number of possible shades of gray is equal to the tile size, which
is (x * x) + (y * y) + 1.  For the example above, we have 33 total possible
shades; on many printers, some of these shades might appear the same (like
the very black ones on Canon engines.)