#10: How can I tell if a PNG has transparency?

I have a PNG, and I want to know if the background (or any regions) are transparent.

Use the command-line tools from ImageMagick

If you have the ImageMagick package installed (available for UNIX/MacOSX/Windows), the 'identify' command-line tool can dump information on a given file if it's of a format supported by ImageMagick.

To dump transparency information about a file use the following command:
"identify -format %A <filename>"

This will return a simple "True" or "False" depending on whether the image has a transparency layer or not.

Think you've got a better solution? Help Unknown_user_icon kevin out by posting your solution

More image properties

http://www.imagemagick.org/script/escape.php - found by Unknown_user_icon ivan on April 15, 2009, 06:20 PM UTC

List of properties that 'identify' can dump from an image.

Tags: reference imagemagick image tool

ImageMagick's 'identify' command

http://www.imagemagick.org/Usage/basics/#identify - found by Unknown_user_icon ivan on April 15, 2009, 06:19 PM UTC

ImageMagick's 'identify' command-line basics.

Tags: image command-line tool