Help needed creating Alpha PNG image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mickeyportilla

Help needed creating Alpha PNG image

Post by mickeyportilla »

I am using magick++/c++. I have a PNG32 image that I would like to load and create a new image from that will only contain the alpha channel as the image. The new image would ideally be saved a PNG8. Basically instead of using a PNG32 I would be using two images, a JPG for the color image and a PNG8 as the alpha. Any help appreciated, thanks!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Help needed creating Alpha PNG image

Post by magick »

Use image.channel( AlphaChannel ) to extract the alpha channel and then image.write() to write it as PNG8.
mickeyportilla

Re: Help needed creating Alpha PNG image

Post by mickeyportilla »

That worked perfectly, thank you!
Post Reply