Bug in scaling images using alpha, using convert >6.3.5

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
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in scaling images using alpha, using convert >6.3.5

Post by anthony »

Why are you separating the 4 channels?

Resizing the individual channels of an image (by separting them) results in a well know 'halo' bug, that has been documented in IM examples...
http://imagemagick.org/Usage/bugs/resize_halo/
the same effect is related to the Blur with transparency Bug
http://imagemagick.org/Usage/bugs/blur_trans/

Basically by separating the channels you are telling IM to treat each channel as a pure gray scale image. that means a fully-transparent color, really has a color (usally black) that should be preserved! thus you see a halo!

If you want IM to hand Transparency correctly you need to resize the image without separating the channels. try this instead of your previous complex set of commands...

Code: Select all

convert ice.png  -filter point -resize 32x32 out.png
ASIDE: -size in your commands did nothing. Also I assume you used a -filter point to preserve the original color table and not generate new colors. The -sample resize operator also does this.

Code: Select all

  convert ice.png  -sample 32x32 out.png
And please read IM Examples, Basics, as you are placing all the options BEFORE the images to process. This is a legacy method and is not guranteed to order image processing options correctly. That was a MAJOR problem with IM v5 and was the reason for Version 6 IM being developed in the first place!

And finally, report the version numbers of the IM you are using. The resize Halo bug was fixed in an early version of IM v6.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply