transparency info losted when resize Indexed-Color png

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
twfjqm
Posts: 1
Joined: 2013-03-18T05:30:27-07:00
Authentication code: 6789

transparency info losted when resize Indexed-Color png

Post by twfjqm »

Dear Everybody

I had some trouble when I load a Indexed-Color png image with transparency channel and then resize it.
the transparent info of result had been lost. I search on the google and also the borad here.
But I can not find any useful information. can anybody help me?

My ImageMagick Version is 8.3.1.

best regards,


WF Tao
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: transparency info losted when resize Indexed-Color png

Post by fmw42 »

I think you need to post a link to your input png and show us your exact command.

I have no trouble with the following in IM 6.8.3.10 Q16 Mac OSX Snow Leopard

convert logo: -transparent white logot.png

It is of type palettealpha

When I resize it in half using -resize, it is converted to truecoloralpha due to the alpha channel being converted from binary to 8-bit. But it still has its transparency.


To keep it palettealpha, you would need to resize using -sample if minifying.

If enlarging, I believe you could use -sample or -scale.
Post Reply