Getting transparent color?

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
aditan22

Getting transparent color?

Post by aditan22 »

Hi,

I've been searching about this thing and couldn't find it. How to get the transparent color of an image? my purpose is creating another image (not duplicating) which has the same transparent color. Another purpose is to check whether an image has transparency or not.

So...is there any method to do that?

Thanks.
aditan22

Post by aditan22 »

is there any function / method to do this? I need this one....

thanks.
aditan22

Post by aditan22 »

Geee... since it has no answer, I think there's no function to get the transparent color of an image, it's not a good thing because we will often need it :(
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Getting transparent color?

Post by anthony »

All I know is the transparent color is saved as image meta-data attribute, for later use if the -transparnet-color setting is not defined.

Internally how this is done' I have not looked, but following the command line API is not too difficult.

Use the source Luke!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
aditan22

Re: Getting transparent color?

Post by aditan22 »

thanks for the info, although I still didn't get it how to return the image's transparent color, I just compare with imagecolortransparent from GD.
tsr

Re: Getting transparent color?

Post by tsr »

Well, you can easily get the info from the return string from MagickDescribeImage(), just look at the output and it should be fairly straightforward to get the transparent color attribute from it.

FR: MagickDescribeImageArray() ?

/tsr
aditan22

Re: Getting transparent color?

Post by aditan22 »

thanks! I'll definitely try that...!
Post Reply