Page 1 of 1

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

Posted: 2008-02-10T19:02:47-07:00
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.