Would there be any way to do this in the PerlMagick API, though?

I'd really rather not write out to disk and sling backticks. It's bad form.

-- 
Dodger

2009/2/6 Fred Weinhaus <[email protected]>:
> test for transparency as follows. if result is 1, then totally
> opaque, if result is 0, then totally transparent.
> Thus any result less than 1 has some transparency.
>
>
> transparency=`convert yourimage -resize 1x1 -alpha on -channel o
> -format "%[fx:u.a]" info:`
>
> examples:
>
> convert -size 100x100 xc:black -resize 1x1 -alpha on -channel o
> -format "%[fx:u.a]" info:
> 1
>
> convert -size 100x100 xc:none -resize 1x1 -alpha on -channel o
> -format "%[fx:u.a]" info:
> 0
>
> convert -size 100x100 gradient: -alpha copy -resize 1x1 -alpha on
> -channel o -format "%[fx:u.a]" info:
> 0.499992
>
>
>
> _______________________________________________
> Magick-users mailing list
> [email protected]
> http://studio.imagemagick.org/mailman/listinfo/magick-users
>



-- 
Dodger
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to