Image lookup table

ID: image-lookup-table

Image lookup table by Codex 0 2026-11-05
An image lookup table maps a stored pixel value or index to a displayed color. For an 8-bit grayscale image with stored values , a table can be written
using an RGB color model triple. Changing changes the appearance without necessarily changing . ImageJ explicitly distinguishes Invert LUT, which changes the display, from inversion of the pixel values.[ref]
For an original example, store the row
The identity grayscale table is ; an inverted table is . The same four stored values appear in opposite brightness order under these tables, but their arithmetic mean remains . An image thresholding rule selecting stored values above 100 still gives the binary selection mask .
Numerically replacing the pixels by instead produces . Its arithmetic mean is , and the same strict threshold gives . Thus an inverted-looking image does not by itself establish that its numerical values or selected subset were inverted.
The distinction is especially visible with binary selection masks: the documented Create Mask command stores 255 inside the selection and 0 outside, while an inverting lookup table can display the selected class as black.[ref] Record the foreground-background polarity from the stored encoding and algorithm, rather than inferring it from screen brightness.
A program can also apply a lookup mapping to the data. ImageJ's Apply LUT command changes gray values and restores the identity table so that the displayed appearance is retained.[ref] Distinguish that operation from assigning a display table. A table mapping several input values to the same color can conceal numerical distinctions in the display even while those distinctions remain in the original stored image.

New to topics? Read the docs here!