Back to Imagemagick

Colormap

www/api/colormap.html

7.1.2-181.4 KB
Original Source

Colormap

Select API Method

AcquireImageColormap

AcquireImageColormap() allocates an image colormap and initializes it to a linear gray colorspace. If the image already has a colormap, it is replaced. AcquireImageColormap() returns MagickTrue if successful, otherwise MagickFalse if there is not enough memory.

The format of the AcquireImageColormap method is:

MagickBooleanType AcquireImageColormap(Image \*image,const size\_t colors, ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. colorsthe number of colors in the image colormap. exceptionreturn any errors or warnings in this structure.

CycleColormap

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.

WARNING: this assumes an images colormap is in a well know and defined order. Currently Imagemagick has no way of setting that order.

The format of the CycleColormapImage method is:

MagickBooleanType CycleColormapImage(Image \*image,const ssize\_t displace, ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. displace displace the colormap this amount. exceptionreturn any errors or warnings in this structure.