imlut(img, lut, kind, order, colorScheme)
This function applies 1D or 3D LUTs to image data for color gradient calibration.
A good description of LUTs can be found here:
http://www.lightillusion.com/luts.html
Syntax: [img_lut] = imlut(img,lut,kind,order)
Inputs:
img - the image on which the lut shall be applied, format double,
uint8 or uint16
lut - the color lookup table (either 1D or 3D)
kind - a string '1D' or '3D' specifying whether a 1D LUT or 3D LUT is used
order - order of LUT entries. We differentiate between 'standard' (default) and 'inverse' order. Examples:
Standard Order Inverse Order
R G B R G B
0 0 0 0 0 0
1 0 0 0 0 1
2 0 0 0 0 2
0 1 0 0 1 0
1 1 0 0 1 1
2 1 0 0 1 2
0 2 0 0 2 0
... ...
2 2 2 2 2 2
Outputs:
img_lut - image after colors are changed according to LUT,
format double, uint8 or uint16 depending on LUT values
Example:
img = imread('path_to_image');
lut = dlmread('path_to_lut.cube', ' ', 4, 0);
[img_lut] = imlut(img, lut, '3D', 'standard')
imshow(img_lut)
Cite As
Christopher (2024). imlut(img, lut, kind, order, colorScheme) (https://www.mathworks.com/matlabcentral/fileexchange/43004-imlut-img-lut-kind-order-colorscheme), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Image Processing Toolbox > Import, Export, and Conversion > Image Type Conversion >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.