Created attachment 18872 [details] Comparison of angles for accurate screens with frequency 150 and resolutuion 600,720,750 DPI When using the device tiffsep1 with `/AccurateScreens true` I get inverted angles when the frequency is not a divisor of the resolution. ``` %!PS-Adobe-3.0 << /HalftoneType 1 /Frequency 150 /Angle 75 /SpotFunction { abs exch abs 2 copy add 1 gt { 1 sub dup mul exch 1 sub dup mul add 1 sub } { dup mul exch dup mul add 1 exch sub } ifelse } /AccurateScreens true >> /Default exch /Halftone defineresource sethalftone << /PageSize [10 10] >> setpagedevice 0.75 0.5 0 0 setcmykcolor newpath 0 0 moveto 10 0 lineto 10 10 lineto 0 10 lineto closepath fill showpage ``` Running this with `gs -dBATCH -dNOPAUSE -sDEVICE=tiffsep1 -sOutputFile=test-720.tif -r720 -f test.ps` results in inverted angles compared to the results of `-r600` or `-r750`. ----------------------------------------------- Additionally, I noticed a similar flip when using no accurate screens and having a large factor between frequency and resolution. Bisecting on the resolution (with `gs -dBATCH -dNOPAUSE -sDEVICE=tiffsep1 -sOutputFile=test2-465.tif -r465 -f test2.ps`) for the following file pinned down the flip bewteen `-r465` and `-r466`: ``` %!PS-Adobe-3.0 << /HalftoneType 1 /Frequency 20 /Angle 75 /SpotFunction { abs exch abs 2 copy add 1 gt { 1 sub dup mul exch 1 sub dup mul add 1 sub } { dup mul exch dup mul add 1 exch sub } ifelse } %/AccurateScreens true >> /Default exch /Halftone defineresource sethalftone << /PageSize [10 10] >> setpagedevice 0.75 0.5 0 0 setcmykcolor newpath 0 0 moveto 10 0 lineto 10 10 lineto 0 10 lineto closepath fill showpage ``` Similarly, a flip can be pinned down when using no halftone dictionary but setting `-dDITHERPPI` with `gs -dBATCH -dNOPAUSE -sDEVICE=tiffsep1 -sOutputFile=test3-966.tif -r966 -dDITHERPPI=20 -f test3.ps` and the following file: ``` %!PS-Adobe-3.0 << /PageSize [10 10] >> setpagedevice 0.75 0.5 0 0 setcmykcolor newpath 0 0 moveto 10 0 lineto 10 10 lineto 0 10 lineto closepath fill showpage ``` The flip happens between `-r966` and `-r967`.
Assigning to Ray as this is very similar to the problem fixed in this commit: http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=bf689ee0bff720f202ebc98f301c765f34e2c1fa FWIW its possible the accurate screens case is fixed, though its hard to be sure on such a small sample. The regular screens case is more obviously incorrect.
Created attachment 20408 [details] Modified sample file with pointed spot function. I confirm that there's a flip between 465 and 466 dpi. One is rotated clockwise, another is rotated counter-clockwise. The spot function in my halftone draws an isosceles triangle. The halftone angle is a negative of the angle between X axis and a line of symmetry of the triangle. Negation is needed because halftone angles are measured clockwise.