Colorspace Transformations

버전 1.4.0.0 (66.2 KB) 작성자: Pascal Getreuer
Transform colors between sRGB, YCbCr, YPbPr, YUV, YIQ, HSV, HSL, HSI, XYZ, Lab, Luv, LCH, CAT02 LMS
다운로드 수: 18.6K
업데이트 날짜: 2011/1/14

라이선스 보기

편집자 메모: 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'.

인용 양식

Pascal Getreuer (2024). Colorspace Transformations (https://www.mathworks.com/matlabcentral/fileexchange/28790-colorspace-transformations), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.4.0.0

added tags, minor update in documentation

1.3.0.0

* Added missing colorspace.h file---thanks to William Cook
* Added M-code version colorspace.m
* Added JPEG-Y'CbCr
* ITU-R BT.709 gamma correction replaced with more standard sRGB definition
* Fix in Xyz2Luv
* Fix in CIE tongue demo