Page 1 of 1

alpha channel + filtering

Posted: 2014-03-06T09:07:16-07:00
by jrkoonce
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!

Re: alpha channel + filtering

Posted: 2014-03-06T09:50:06-07:00
by jrkoonce
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.