image colormap not updated after composite

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
xinito

image colormap not updated after composite

Post by xinito »

Dear all,

I used

img1.composite(img2, 0, 0, Magick::DifferenceCompositeOp);

After that, I query img1.colorMapSize() and img1.colorMap(i), where i=1 to colorMapSize. It turned out that they are still of the img1 before composite operation.

Is there a way to get img1's colorMap information updated after composition?

Thank you.

nito
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: image colormap not updated after composite

Post by magick »

A truecolor image can still have a colormap even though its not used. Add image.Quantize() to create a new colormap.
Post Reply