MagickPassFail AllocateImageColormap( Image *image, const unsigned long colors );
AllocateImageColormap() allocates an image colormap and initializes it to a linear gray colorspace with increasing intensity. If the image already has a colormap, it is replaced. AllocateImageColormap() returns MagickPass if successful, otherwise MagickFail if there is not enough memory.
The format of the AllocateImageColormap method is:
MagickPassFail AllocateImageColormap( Image *image, const unsigned long colors );
The image.
The number of colors in the image colormap.
MagickPassFail CycleColormapImage( Image *image, const int amount );
CycleColormap() displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect.
The format of the CycleColormapImage method is:
MagickPassFail CycleColormapImage( Image *image, const int amount );
A description of each parameter follows:
The image.
Offset the colormap this much.
MagickPassFail ReplaceImageColormap( Image *image, const PixelPacket *colormap, const unsigned int colors );
ReplaceImageColormap() replaces an existing image colormap with a new image colormap. The new image colormap is expected to contain all of the colors from the existing colormap. The existing colormap indexes are adjusted to conform with positions in the new colormap. If the new colormap contains duplicate entries, then the associated colormap index will point to the first entry found in the colormap and other matching entries will not be used. MagickPass is returned if the operation is successful, otherwise MagickFail is returned, and image->exception is updated with the cause of the failure.
This function is useful in case colormap entries need to match across multiple images or otherwise occupy specific locations.
The format of the ReplaceImageColormap method is:
MagickPassFail ReplaceImageColormap( Image *image, const PixelPacket *colormap, const unsigned int colors );
image in which to replace colormap.
new colormap.
number of colors in new colormap.
Copyright © GraphicsMagick Group 2002 - 2023