Code: Select all
//QuantumSize equals 8
//images - is a pointer to memory where data stored
Magick::Image img(64, 64, "RGBA", Magick::CharPixel, images);
// converting to 8-bits indexed
img.type(Magick::PaletteMatteType);
Now storing to file palette information:
int count = img.colorMapSize();
const MagickLib::Image* imgptr = img.constImage();
fwrite(imgptr->colormap, sizeof(unsigned int), count, pf);
Could someone clarify how to solve this issue?