Dear Qins:
which command can judge whether a png pic has alpha channel ?
which command can judge whether a png pic has alpha channel ?
Re: which command can judge whether a png pic has alpha channel ?
My favorite is "pngcheck", which you can get fromhttp://www.libpng.org/pub/png/apps/pngcheck.html
On *nix, you have "file" and can type
(although this will miss PNG files where the alpha is conveyed via the tRNS chunk).
If you prefer to use ImageMagick, type and look for lines containing "png:IHDR.color_type:" and "png:tRNS"
Code: Select all
pngcheck file.png
Code: Select all
file file.png
If you prefer to use ImageMagick, type
Code: Select all
identify -verbose file.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: which command can judge whether a png pic has alpha channel ?
see string format %[channels] or %[opaque] at http://www.imagemagick.org/script/escape.php
Code: Select all
convert image -format " %[channels]" info:
Code: Select all
convert image -format " %[opaque]" info: