alpha channel + filtering

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
jrkoonce
Posts: 2
Joined: 2014-03-06T08:56:39-07:00
Authentication code: 6789

alpha channel + filtering

Post by jrkoonce » 2014-03-06T09:07:16-07:00

I have an RGBA image, and when I run a median filter on it, I lose the alpha channel. Here's my C++:

Code: Select all

Magick::Image magk(width, height, "RGBA", Magick::FloatPixel, pPixels);

magk.alphaChannel(Magick::ActivateAlphaChannel);
magk.channel(static_cast<MagickCore::ChannelType>(Magick::RedChannel|Magick::GreenChannel|Magick::BlueChannel|Magick::AlphaChannel));
magk.medianFilter(radius);
RGB come out correctly, but the alpha channel comes out solid white. I have played with various parameters but no no avail.

The code and API docs don't really explain a lot... Thanks for any help!

jrkoonce
Posts: 2
Joined: 2014-03-06T08:56:39-07:00
Authentication code: 6789

Re: alpha channel + filtering

Post by jrkoonce » 2014-03-06T09:50:06-07:00

FYI:

magk.type() = TrueColorMatteType
magk.colorspaceType() = UndefinedColorSpace

If I set the colorspace to TransparentColorSpace it has no affect, and alpha is still stripped from the image by the filter.

Post Reply