Table of Contents

## Name

im_maplut - map an image through a lookup table

## Synopsis

#include <vips/vips.h>

int im_maplut(in, out, lut)
IMAGE *in, *out, *lut;

## Description

im_maplut() maps an image through another image, acting as a LUT (Look Up Table). The lut may have any type, and the output image will be of that type.

The input image must be an unsigned integer types, that is, it must be one of FMTUCHAR, FMTUSHORT or FMTUINT.

If the input is FMTUCHAR, then the LUT must have 256 elements, in other words, lut->Xsize * lut->Ysize == 256.

If the input is FMTUSHORT or FMTUINT, then the lut may have any number of elements, and input pels whose value is greater than lut->Xsize * lut->Ysize are mapped with the last LUT element. The function counts and prints the number of image elements which overflow in this way.

As regards bands, there are three cases:

- If LUT has one band, then the input may have any number of bands, and
each band will pass through the same LUT.

- If LUT has the same number of bands as the input, then each band of the
input will be LUTed separately.

- If the input has one band, then the LUT may have any number of bands, and
the output will have the same number of bands as the LUT.

## Return Value

All functions returns 0 on success and -1 on error.

## See Also

im_histgr(3) , im_hsp(3) , im_heq(3) , im_identity(3) .

## Copyright

1995, National Gallery and Birkbeck College

## Authors

J. Cupitt, 1995
N. Dessipris - 10/05/1991

Table of Contents

- Name
- Synopsis
- Description
- Return Value
- See Also
- Copyright
- Authors