Created attachment 19813 [details] Black channel separation with artifacts and same angle for all squares I have following example postsrcipt code ``` %!PS-Adobe-3.0 << /PageSize [99 33] >> setpagedevice /size 33 def /rect { newpath 0 0 moveto size 0 lineto size size lineto 0 size lineto closepath fill } def << /HalftoneType 1 /Frequency 100 /Angle 60 /SpotFunction { pop } >> sethalftone 0.5 0.5 0.5 0.5 setcmykcolor rect size 0 translate rect << /HalftoneType 1 /Frequency 100 /Angle 45 /SpotFunction { pop } >> sethalftone size 0 translate rect showpage ``` Which should render three squares with different halftone screens (default, angle 60, angle 45) next to each other. However, when putting this into `gs -dNOPAUSE -dBATCH -r600 -sDEVICE=tiffsep1 -sOutputFile=test%d.tif test.ps` I get all three with the same halftones and there are artifacts that look like memory corruption in the halftone buffer. This has been first reported here: https://stackoverflow.com/questions/63827886/is-using-multiple-halftone-screens-on-the-same-page-allowed-in-postscript-3
Since I can't edit the original post: Originally I had the first sethalftone after the first rect draw command so it would be drawn with the default settings but I tried to simplify the report and mixed things up. To clarify: We now have 3 squares where the first two should have the same halftone (angle=60) and the last one another (angle=45) but we still see only one halftone across all 3 of them in the tiffs.
Sorry for the confusion. The tiffsep1 device actually renders the page in contone mode, then applies the halftone afterwards. We might look at changing it (or making another device) that renders the page to 1-bit planes which would be required for what you want. This device was developed as an example for a customer that wanted to perform halftoning that way. They have since implemented their own device. Note that if the page has transparency, transparency MUST be performed in contone, so the result will be halftoned all using the halftone in effect at when the page is complete, so the result will be the same as what you see with tiffsep1 even with simple monochrome devices like pbmraw or tiffg4.
Thanks for the quick response. Just to make sure I understand you correctly: There is currently no way to generate halftoned, channel separated CMYK output with multiple screens in ghostscript? I understood that tiffsep1 cannot have multiple screens by design but there is also no other device which would allow to achieve that? Furthermore, it seems that there is some sort of memory corruption when using multiple screens in one file with tiffsep1. Maybe you want to look into that, too.
Thanks for the comment on the memory corruption. There is the pamcmyk4 device which generates CMYK. Spot colors are rendered as CMYK, so overprint is ignored for them, but CMYK can be overprinted, and the CMYK halftone can be changed. I've attached the sample output from your file using: bin/gs -r72 -sDEVICE=pamcmyk4 -o x.pam x.ps which can be viewed with: bin/gs -r72 -dSCALE=1 --permit-file-read=x.pam -- lib/viewpbm.ps x.pam The header of the PAM file looks like this: P7 WIDTH 99 HEIGHT 33 DEPTH 4 MAXVAL 255 TUPLTYPE CMYK # Image generated by GPL Ghostscript GIT PRERELEASE ENDHDR
Created attachment 19831 [details] x.pam
Many thanks for the followup. pamcmyk4 is good enough for our purposes.
Thank you for letting us know. The tiffsep1 device will probably stay the way it is because it also allows for downscaling, which requires 8-bit per plane and halftoning after the downscale action. The support for the extra downscaler features makes it worth keeping as is. We still may do a halftoned device that supports spot color separations. Note that any such device won't be able to synthesize a 'composite' CMYK as tiffsep does. I looked at tiffsep1 and it doesn't do that even though the it could, since it does have the contone data. Changing this to 'enhancement' since it may lead to doing a CMYK+spot 1-bit tiff device, or at least adding a CMYK composite to tiffsep1.