Converting GIF to PNG losing transparency w/ 6.6.1-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
stopdropandrew

Converting GIF to PNG losing transparency w/ 6.6.1-5+

Post by stopdropandrew »

Code: Select all

>identify sitewide_sprite.gif
sitewide_sprite.gif GIF 570x250 570x250+0+0 8-bit PseudoClass 128c 10.8KB 0.000u 0:00.000

>convert -verbose sitewide_sprite.gif sitewide_sprite.png
sitewide_sprite.gif GIF 570x250 570x250+0+0 8-bit PseudoClass 128c 10.8KB 0.000u 0:00.009
sitewide_sprite.gif=>sitewide_sprite.png GIF 570x250 570x250+0+0 8-bit PseudoClass 128c 0.010u 0:00.000
convert: tRNS chunk has out-of-range samples for bit_depth `sitewide_sprite.png' @ warning/png.c/PNGWarningHandler/1457.

>identify sitewide_sprite.png 
sitewide_sprite.png PNG 570x250 570x250+0+0 8-bit PseudoClass 128c 8.47KB 0.000u 0:00.299
The resulting PNG doesn't have transparency. You can find the original GIF at http://www.kongregate.com/images/presen ... sprite.gif. I've confirmed the bug in the Mac OSX 6.6.1-5 binaries and also when I built 6.6.1-10 from source.

I have seen it work in 6.5.4-2 and 6.5.3-7 on other machines.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting GIF to PNG losing transparency w/ 6.6.1-5+

Post by fmw42 »

Your gif appears to be corrupted or non-standard format. When I try on IM 6.6.1-10 Q16 Mac OSX Tiger, I get error message:

convert sitewide_sprite.gif sitewide_sprite.png
convert: tRNS chunk has out-of-range samples for bit_depth `sitewide_sprite.png' @ warning/png.c/PNGWarningHandler/1457.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting GIF to PNG losing transparency w/ 6.6.1-5+

Post by snibgo »

On Windows7, IM 6.6.0-8:

convert -verbose sitewide_sprite.gif sitewide_sprite.png

sitewide_sprite.gif GIF 570x250 570x250+0+0 8-bit PseudoClass 128c 10.8KB 0.000u 0:00.005
sitewide_sprite.gif=>sitewide_sprite.png GIF 570x250 570x250+0+0 8-bit PseudoClass 128c 0.000u 0:00.025

identify sitewide_sprite.png
sitewide_sprite.png PNG 570x250 570x250+0+0 8-bit DirectClass 8.61KB 0.000u 0:00.083

The PNG file seems to have the same transparency as the GIF.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Converting GIF to PNG losing transparency w/ 6.6.1-5+

Post by magick »

Most likely its a bug. We alerted the PNG developer. Stand by for a patch in the next week or two.
kvaster

Re: Converting GIF to PNG losing transparency w/ 6.6.1-5+

Post by kvaster »

I'm having the same problem. I'm using imagemagick-6.6.1.7 on gentoo.
Just take an png with transparency and run convert with color reduction to 256 colors. Result png will be without transparency. I need to add -type TrueColorMatte to have transparency enabled and to convert png to indexed type with help of other tool...
Post Reply