-trim reduce the Alpha bits on a PNG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
laeatwork
Posts: 3
Joined: 2012-05-09T05:28:40-07:00
Authentication code: 13

-trim reduce the Alpha bits on a PNG

Post by laeatwork »

Hi,

Trying to create an .ICO file using an .AI file as the source.

The .AI file is converted to a PNG file using 8 bits color and Alpha channel.
Resizing the PNG file into multiple copies and merge them to one IOC files works fine.
The ICO files contains all sizes, nicely transparent icons.

Then when trying to -trim the PNG file, before merging to the IOC file, things stop working.
Found out that the -trim function reduced the Alpha channel to 1-bit.

Is there a way to -trim a PNG, without reducing the Alpha channel?


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

Re: -trim reduce the Alpha bits on a PNG

Post by fmw42 »

what is your exact command. if you need to save as 8-bit pseudocolor, then png (as PNG8) will have binary alpha channel. The only way I know to save with full alpha channel values in IM is to save to 32-bit color (as PNG32). Also what version of IM are you using and what platform. If the above is insufficient, then post a link to one of your input image that needs to be converted to PNG.

see png details at
http://www.imagemagick.org/Usage/formats/#png
Post Reply