Trouble creating PNG with alpha in Magick++
Posted: 2010-07-15T15:03:29-07:00
Hi, I need to process an image into two 16-bit per channel RGBA pngs, but for some reason I can't edit the alpha channel. I tried doing this just to see if it would work:
I'm doing this to save my image:
It saves out an image with fine color channels, but the alpha channel is all fully opaque. Any idea what I'm doing wrong or how to save out a png with an alpha channel? Thanks.
Code: Select all
size_t columns = normalMap.columns(); size_t rows = normalMap.rows();
Color blar(0.0, UINT_MAX, 0.0, UINT_MAX);
PixelPacket *pixels = view.get(0,0,normalMap.columns(),normalMap.rows());
for ( ssize_t row = 0; row < rows ; ++row )
{
for ( ssize_t column = 0; column < columns ; ++column )
{
blar= *pixels;
Color other(blar.redQuantum() / 2, blar.greenQuantum() /2, blar.blueQuantum() / 2, 0);
*pixels++=other;
}
}
Code: Select all
normalMap.magick("PNG64");
normalMap.write("test.png");