Bug 691704

Summary: No Antialiasing for masks / clipping paths?
Product: Ghostscript Reporter: Thomas Kaiser <ghostscript>
Component: PDF InterpreterAssignee: Alex Cherepanov <alex>
Status: RESOLVED WONTFIX    
Severity: normal CC: bdecherf, christinedelight.top85
Priority: P4    
Version: 9.00   
Hardware: All   
OS: All   
Customer: Word Size: ---
Attachments: Original PDF file
visual comparison
GS 9 result
GS 8.7.2 result
Pitstop Screenshot shwing the masks
Pitstop Screenshot showing the masks
rendering result using tiffscaled

Description Thomas Kaiser 2010-10-22 10:00:42 UTC
I tried to render PDF files with GS 9 as well as 8.72 that were produced by printing PostScript from InDesign and distilling them to PDF. Since the inDesign document uses transparency flattening occured. Some text objects have been converted to an image with a mask applied (here is a screenshot of Pitstop's path view of the PDF in question: http://mail.kaiser-edv.de/msg-EVsPT5it/ScreenshotPitStop.png)

When rendering such a flattened PDF with -dTextAlphaBits=4 -dGraphicsAlphaBits=4 rendering fails:

http://kaiser-edv.de/tmp/p1wnxE/GS-Render-Bug-2.png

(left: GhostScript, right: MacOS X' PDF renderer)

A PDF file to reproduce the behaviour as well as rendered TIFFs from both GS 9.00 and 8.72 (SVN) are available here:

http://kaiser-edv.de/tmp/p1wnxE/

(I tested on both Solaris/Sparc as well as MacOS X Intel to see whether endianess has an influence. No differences)
Comment 1 Ken Sharp 2013-06-12 09:21:13 UTC
Sadly because the files were not attached to the bug report, they are mostly no longer available.

I suspect this is the same (or very similar to) bug #691729. In that case the objects 'disappeared' because a clipped area degenerated to nothing at low resolution. It is certainly true that clips and masks are not anti-aliased, its not really feasible to do so.

I see that this is the same reporter as #692179, so I would suggest that the same fix (use the new tiffscaled32 device) is probably the correct way to go.

I'm going to close this as wontfix, but please feel free to reopen it if this is not resolved by using the tiff32scaled device.
Comment 2 Thomas Kaiser 2013-06-12 12:41:30 UTC
Created attachment 9954 [details]
Original PDF file
Comment 3 Thomas Kaiser 2013-06-12 12:42:27 UTC
Created attachment 9955 [details]
visual comparison
Comment 4 Thomas Kaiser 2013-06-12 12:43:40 UTC
Created attachment 9956 [details]
GS 9 result
Comment 5 Thomas Kaiser 2013-06-12 12:44:40 UTC
Created attachment 9957 [details]
GS 8.7.2 result
Comment 6 Thomas Kaiser 2013-06-12 12:49:13 UTC
Created attachment 9958 [details]
Pitstop Screenshot shwing the masks

I'm not really sure wether the same explanation as in 691729 applies. But if it's 'certainly true that clips and masks are not anti-aliased' then the same fix (using the tiffscaled32 device) is the way to go. I'll give it a try next week and get back to you in case further problems arise. Thx
Comment 7 Thomas Kaiser 2013-06-12 12:50:47 UTC
Created attachment 9959 [details]
Pitstop Screenshot showing the masks

I'm not really sure wether the same explanation as in 691729 applies. But if it's 'certainly true that clips and masks are not anti-aliased' then the same fix (using the tiffscaled32 device) is the way to go. I'll give it a try next week and get back to you in case further problems arise. Thx
Comment 8 Ken Sharp 2013-06-12 13:02:04 UTC
(In reply to comment #6)
> Created attachment 9958 [details]
> Pitstop Screenshot shwing the masks
> 
> I'm not really sure wether the same explanation as in 691729 applies.

Its related, though the result is different. I had a quick test of the file, you don't give a command line so I assumed the one from the previous bug.

The result I see is approximately the same as your attachment (some text is excessively bold and not anti-aliased), using the tiffscaled device shows a marked improvement for me.

Please reopen the bug if you don't find this an acceptable solution.
Comment 9 Ken Sharp 2013-06-12 13:06:48 UTC
Created attachment 9960 [details]
rendering result using tiffscaled

Attached is the result using tiffscaled24 at 600 dpi with a DownScaleFactor of 4 for a final output resolution of 150 dpi. To me this looks better than the tiff24nc result with *AlphaBits=4, because the areas which are masked are now anti-aliased and do not exhibit excessive apparent boldening.