I'm trying to produce a 16-colour indexed/palette/PseudoColor PNG image with transparency. I would like an alpha channel but it doesn't look like this is possible, so I can settle for assigning one of the colours in the palette as transparent (although this means my 16-colour image will become an unusual 17-colours.)
Unfortunately I can't figure out how this should work. I'm using the Magick++ library, and none of these work:
Code: Select all
Magick::ColorRGB x(1, 0, 0);
x.alpha(1.0);
Magick::Image png;
...
png.colorMap(16, x);
Code: Select all
png.matte(true);
png.matteColor(x);
Code: Select all
png.transparent(x);
I can't see any other way to assign transparency for an indexed image, so any pointers would be much appreciated!
EDIT: I'm really struggling to understand the logic here - it looks like there are some fairly major bugs in the library, for example this:
Code: Select all
Magick::Color asdf("transparent");
EDIT2: Never mind, I switched to libpng++ and it works like a dream! I guess ImageMagick is more aimed at image manipulation rather than plain reading and writing of image files.