[comp.lang.postscript] Apple LaserWriter IINT and setscreen

brown@vidiot.UUCP (Vidiot) (03/07/91)

Would some kind soul please explain why the dot frequency values between
47.1405 and 60.6091 (inclusive) result in a frequency of 60.0 being used
internally?  The angle for this to occur is 45 degrees.

I did a little test program that does a set screen and then turn right around
and do a currentscreen to print what the printer is using.

If the angle is 35 degrees, the test goes right through 60 without a problem.
This is using an increment to the frequency of .01 and starting at 59.0.
-- 
      harvard\     att!nicmad\          spool.cs.wisc.edu!astroatc!vidiot!brown
Vidiot  ucbvax!uwvax..........!astroatc!vidiot!brown
      rutgers/  decvax!nicmad/ INTERNET:vidiot!brown%astroatc@spool.cs.wisc.edu

kevina@apple.com (Nobody you know) (03/09/91)

In article <1453@vidiot.UUCP> brown@vidiot.UUCP (Vidiot) writes:
> Would some kind soul please explain why the dot frequency values between
> 47.1405 and 60.6091 (inclusive) result in a frequency of 60.0 being used
> internally?  The angle for this to occur is 45 degrees.
> 
> I did a little test program that does a set screen and then turn right 
around
> and do a currentscreen to print what the printer is using.
> 
> If the angle is 35 degrees, the test goes right through 60 without a 
problem.
> This is using an increment to the frequency of .01 and starting at 59.0.

The reason has to do with the way halftoning is done on a LaserWriter (and 
most of its Level 1 PostScript kin).  The idea is to generate a pattern 
which, when replicated to fill an object, leaves a dot pattern which 
approximates the frequency and angle specified.  It turns out that certain 
combinations of screen frequency and angle do not repeat themselves in 
small patterns.  For efficiency, the PostScript interpreter chooses a 
"next best thing" that can be represented by a reasonably small bitmap.

[Fun fact to know and yell: not only will frequency values from 47.1405 to 
60.6091 result in the same internal frequency, as you have discovered, but 
it is 53 degrees, not 60!]

Level 2 PostScript will have new halftoning mechanisms.  In a Type 1 
(aaah!  not another Type 1!) halftone dictionary, you can add an entry 
called AccurateScreens which will give you what you asked for, but only 
after a great deal of computation.  Two other entries, ActualFrequency and 
ActualAngle, will return the internal values corresponding to the nominal 
frequency and angle which were set.

Good references for all this are the new Red Book, "Digital Halftoning" by 
Ulichney, and part III of "Real World PostScript" edited by Roth.

Moral and shameless plug:  This is a characteristic of most, if not all, 
Level 1 PostScript printers and there is nothing wrong with the Apple 
LaserWriter in this regard, so buy lots of them.

Disclaimer:  Apple probably wants you to buy lots of LaserWriters, too, 
but the words and music are mine only.

--Kevin Andresen [kevina@apple.com]
"You take the wind out of my sails/It must be luff, it must be luff"

brown@vidiot.UUCP (Vidiot) (03/10/91)

In article <12443@goofy.Apple.COM> kevina@apple.com (Nobody you know) writes:
<In article <1453@vidiot.UUCP> brown@vidiot.UUCP (Vidiot) writes:
<> Would some kind soul please explain why the dot frequency values between
<> 47.1405 and 60.6091 (inclusive) result in a frequency of 60.0 being used
<> internally?  The angle for this to occur is 45 degrees.
<> 
<> I did a little test program that does a set screen and then turn right 
<around
<> and do a currentscreen to print what the printer is using.
<> 
<> If the angle is 35 degrees, the test goes right through 60 without a 
<problem.
<> This is using an increment to the frequency of .01 and starting at 59.0.
<
<[Fun fact to know and yell: not only will frequency values from 47.1405 to 
<60.6091 result in the same internal frequency, as you have discovered, but 
<it is 53 degrees, not 60!]

Do you mean 45 degress instead of 60?

<Good references for all this are the new Red Book, "Digital Halftoning" by 
<Ulichney, and part III of "Real World PostScript" edited by Roth.

I had the "Real World PostScript" under my nose and never even noticed.
Thanks the pointer.  I'm going to look at the book now.

The new Red Book, left alot to be desired in this department.
-- 
      harvard\     att!nicmad\          spool.cs.wisc.edu!astroatc!vidiot!brown
Vidiot  ucbvax!uwvax..........!astroatc!vidiot!brown
      rutgers/  decvax!nicmad/ INTERNET:vidiot!brown%astroatc@spool.cs.wisc.edu