Checking if image is transparent

View: New views
2 Messages — Rating Filter:   Alert me  

Checking if image is transparent

by zaske :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
To make an image transparent i use the transparentImage method of MagickImage, but I need to know if a given image has a transparent color set.
Or to put my question in other words -
I loaded an image into MagickIMage object. How can I determine if this image has a color that is defined as transparent?


Thanks,
Yair

Re: Checking if image is transparent

by Bob Friesenhahn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 31 Mar 2008, zaske wrote:
> Or to put my question in other words -
> I loaded an image into MagickIMage object. How can I determine if this image
> has a color that is defined as transparent?

Check to see if the "matte" attribute flag is set.  This flag enables
use of transparency ("opacity") at all.  However, even if it is set,
it is possible that there are no pixels with transparency.  The only
way to know for sure is to test all of the pixels.

Bob
======================================
Bob Friesenhahn
bfriesen@..., http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

_______________________________________________
JMagick mailing list
JMagick@...
http://www.yeo.id.au/mailman/listinfo/jmagick
Please ensure that JMagick@... is a recipient when replying.