Possible aliasing bug when resizing an EPS with transparency to PNG

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 21863
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Possible aliasing bug when resizing an EPS with transparency to PNG

Post by fmw42 » 2017-08-11T09:56:39-07:00

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

User avatar
magick
Site Admin
Posts: 10684
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2017-08-12T04:37:39-07:00

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

User avatar
fmw42
Posts: 21863
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2017-08-12T11:09:32-07:00

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.

Post Reply