ImageFilterColorMap()

These are passed to the function ImageFilters (see ImageFilter() documentation) which convert gray values to colors.

ImageFilterColorMap( type=string, lineColor1=string, lineColor2=string );

Returns: any

Argument Description
type
string, required

type of the color map, possible values are:

  • spectrum: A colormap with the colors of the spectrum
  • linear: A colormap which interpolates linearly between two colors
  • grayscale: A grayscale colormap. Black is 0, white is 1
lineColor1
string, optional

used only for type "linear", the color corresponding to value 0 in the colormap.

Alias: lineColour1

lineColor2
string, optional

used only for type "linear", the color corresponding to value 1 in the colormap.

Alias: lineColour2

Examples

img = imageRead("https://dev.lucee.org/uploads/default/original/2X/6/63711fa0d32b7ebd71a71286b77aa555c8d034fa.jpeg");
filter = "life";
map = ImageFilterColorMap(type="spectrum");
params = {
	colormap: map,
	iterations: 20,
	newColor: "990000",
};
ImageFilter(image = img, filtername = filter, parameters = params);
imageWriteToBrowser(img);

See also