alpha channel and Fred's Imagemagick Tidbits
Posted: 2011-03-21T02:57:49-07:00
I'm trying some commands from here: http://www.fmwconcepts.com/imagemagick/ ... .php#alpha
and they don't seem to work as per Fred's examples. Is Fred wrong or is ImageMagick broken?
Version: ImageMagick 6.6.7-10 2011-03-01 Q16 http://www.imagemagick.org on Slackware 13.0 x86_64
Test If Image Has Alpha Channel
Fred's "Method 1" gives the same results here, but "Method 2" doesn't.
e.g. Fred's "Method 2" example:
convert -size 100x100 xc:white white.png
convert white.png -format "%A" info:
False
convert white.png -alpha on white_alpha.png
convert white_alpha.png -format "%A" info:
True
But I get:
convert -size 100x100 xc:white white.png
convert white.png -format "%A" info:
False
convert white.png -alpha on white_alpha.png
convert white_alpha.png -format "%A" info:
False
Measure The Average Opacity Or Transparency Of An Image
Fred says:
Set 60% Opacity (40% Transparency)
convert logo.jpg -alpha on -channel o -evaluate set 60% logo_opacity60.png
convert logo_opacity60.png -format "%[fx:u.o]" info:
returns opacity of 0.6
convert logo_opacity60.png -format "%[fx:u.a]" info:
returns alpha/transparency of 0.4
But I get:
convert logo_opacity60.png -format "%[fx:u.o]" info:
0.4
convert logo_opacity60.png -format "%[fx:u.a]" info:
0.6
Cheers,
Peter
and they don't seem to work as per Fred's examples. Is Fred wrong or is ImageMagick broken?
Version: ImageMagick 6.6.7-10 2011-03-01 Q16 http://www.imagemagick.org on Slackware 13.0 x86_64
Test If Image Has Alpha Channel
Fred's "Method 1" gives the same results here, but "Method 2" doesn't.
e.g. Fred's "Method 2" example:
convert -size 100x100 xc:white white.png
convert white.png -format "%A" info:
False
convert white.png -alpha on white_alpha.png
convert white_alpha.png -format "%A" info:
True
But I get:
convert -size 100x100 xc:white white.png
convert white.png -format "%A" info:
False
convert white.png -alpha on white_alpha.png
convert white_alpha.png -format "%A" info:
False
Measure The Average Opacity Or Transparency Of An Image
Fred says:
Set 60% Opacity (40% Transparency)
convert logo.jpg -alpha on -channel o -evaluate set 60% logo_opacity60.png
convert logo_opacity60.png -format "%[fx:u.o]" info:
returns opacity of 0.6
convert logo_opacity60.png -format "%[fx:u.a]" info:
returns alpha/transparency of 0.4
But I get:
convert logo_opacity60.png -format "%[fx:u.o]" info:
0.4
convert logo_opacity60.png -format "%[fx:u.a]" info:
0.6
Cheers,
Peter