Page 1 of 1

Possible aliasing bug when resizing an EPS with transparency to PNG

Posted: 2017-08-11T09:56:39-07:00
by fmw42
In IM 6.9.9.5 Q16, there is no issue. But with IM 7.0.6.5 Q16 HDRI, when one resizes during conversion of a CMYK EPS with transparency, the result gets aliased edges. If there is no resize, the command works fine. If one pipes before resizing there is no problem. See viewtopic.php?f=1&t=32469&p=148733#p148733

PS I am using Ghostscript 9.21

Re: Possible aliasing bug when resizing an EPS with transparency to PNG

Posted: 2017-08-12T04:37:39-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

A mask associated with an image persists until it is modified or removed. This may produce unexpected results for complex command-lines. Here we only want to clip when applying the alpha option, not the resize:

Code: Select all

convert -density 300 -colorspace srgb image.eps -alpha transparent -clip -alpha opaque +clip -resize 1000x1000 -strip image.png

Re: Possible aliasing bug when resizing an EPS with transparency to PNG

Posted: 2017-08-12T11:09:32-07:00
by fmw42
Thanks. That command does seem to work fine in IM 7.0.6.6 and IM 7.0.6.7beta Q16 HDRI Mac OSX as

Code: Select all

magick -density 300 -colorspace srgb test1.eps -alpha transparent -clip -alpha opaque +clip -resize 1000x1000 -strip image.png
So the solution in IM 7 is turning off clipping before resizing. I take it that IM 6 does this automatically.