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.
With the current Version 6.7.3-4 a GIF image with a transparent background has a black background after resizing to 16x16. It worked well with Version 6.6.9-10 and also seems to work for dimensions larger than 16x16.
I can confirm this behaviour in Versions 6.7.7-5/6.7.6-4 (gentoo) and 6.6.2-6 (ubuntu).
Converting a gif with transparency to a gif with less then 17px width/height results in a black gif.
Thanks for the hint. I have to compare the results of resize and sample first before fixing our application.
Are there any well-known-but-poor-documented pitfalls when switching from resize to sample?
wolverime wrote:Thanks for the hint. I have to compare the results of resize and sample first before fixing our application.
Are there any well-known-but-poor-documented pitfalls when switching from resize to sample?
-sample will be faster but it just skips pixels to reduce the image. So it does not take into account all the pixels.
-scale will be faster, but it just averages blocks of pixels
Both the above can show artifacts, the latter showing blurring and the former aliasing or moire.
-resize does an interpolated resizing with various filter options. It will give the best looking results, but will be a bit slower.
I didn't intend to recommend "-sample" as a permanent solution but just as a workaround and a clue as to what is going wrong with -resize and transparency.
Thanks, I already took a look at the docu.
I think, I'm going to choose a very pragmatic way and use -sample for all gif manipulations having a width < 17 px and leave the other transformations untouched
Maybe I can remove this workaround one day if this behaviour is fixed in newer IM versions.
Writing as PNG or TXT instead of GIF retains the transparency. Therefore the bug is probably in the GIF encoder.
I also tried converting to PNG8 and then converting the PNG8 to GIF. The PNG8 has GIF-style transparency but again it's
lost in the GIF.