Colorspace Transformations
Nota dell'editore: This file was selected as MATLAB Central Pick of the Week
This package converts colors between sRGB, Y'PbPr, Y'CbCr, JPEG-Y'CbCr, Y'UV, Y'IQ, Y'DbDr, HSV, HSL, HSI, CIE XYZ, CIE L*a*b* (CIELAB), CIE L*u*v* (CIELUV), and CIE L*ch (CIELCH), and CIE CAT02 LMS. It can be used either as part of a C/C++ program or compiled as a MATLAB MEX function.
For use in Matlab, colorspace is compiled as a MEX function by entering
mex colorspace.c
on the Matlab command console. As an alternative to MEX, a pure M-code version colorspace.m is also included.
For use in C programs, an example command line program colorcalc is included.
B = colorspace(S,A) converts the color representation of image A where S is a string specifying the conversion. S tells the source and destination color spaces, S = 'dest<-src', or alternatively, S = 'src->dest'. Supported color spaces are
'RGB' = sRGB IEC 61966-2-1
'YPbPr' = Luma (ITU-R BT.601) + Chroma
'YCbCr' = Luma + Chroma
'JPEG-YCbCr' = space used in JPEG
'YUV' = NTSC PAL Y'UV Luma + Chroma
'YIQ' = NTSC Y'IQ Luma + Chroma
'YDbDr' = SECAM Luma + Chroma
'HSV' or 'HSB' = Hue Saturation Value/Brightness
'HSL' or 'HLS' = Hue Saturation Luminance
'HSI' = Hue Saturation Intensity
'XYZ' = CIE XYZ
'Lab' = CIE L*a*b* (CIELAB)
'Luv' = CIE L*u*v* (CIELUV)
'LCH' = CIE L*C*H* (CIELCH)
'CAT02 LMS' = CIE CAT02 LMS
All transforms assume 2 degree observer and D65 illuminant. Color space names are case insensitive. When sRGB is the source or destination, it can be omitted. For example 'yuv<-' is short for 'yuv<-rgb'.
Cita come
Pascal Getreuer (2024). Colorspace Transformations (https://www.mathworks.com/matlabcentral/fileexchange/28790-colorspace-transformations), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- Image Processing and Computer Vision > Image Processing Toolbox > Import, Export, and Conversion >
- Image Processing and Computer Vision > Image Processing Toolbox > Image Segmentation and Analysis > Image Segmentation > L*a*b* Color Space >
Tag
Riconoscimenti
Ispirato: hslcolormap, colormapgen, cbrewer2, Perceptually improved colormaps, Generate maximally perceptually-distinct colors, Explore Experimental Data
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
colorspace/
Versione | Pubblicato | Note della release | |
---|---|---|---|
1.4.0.0 | added tags, minor update in documentation |
||
1.3.0.0 | * Added missing colorspace.h file---thanks to William Cook
|