Append+ function on indexed images

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.
Posts: 22
Joined: 2018-10-03T08:08:10-07:00
Authentication code: 1152

Append+ function on indexed images

Post by mattyrb »

I have two indexed colour images (16 colours). I'd appended them together and was hoping that the palettes would be stacked one after the other but Imagemagick seems to optimise the palette? I notice in most cases the 16th colour is moved to the 2nd colour (index position 1) and the rest of the palette is left untouched. Could someone tell me what rules are being applied to optimise the palette?

Best wishes,

Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Append+ function on indexed images

Post by snibgo »

IM doesn't guarantee to do anything in particular with palettes. You could examine the source code to see what it happens to do currently and how it orders the entries, but that could change in future versions.

IM doesn't provide control of palettes for users. Gimp does.
snibgo's IM pages: