File Exchange

image thumbnail


version (1.86 KB) by Mark Ruzon
Converts an image from the RGB color space to the CIELAB color space.


Updated 06 May 2009

View License

CIELAB is a nonlinear transformation of RGB where the Euclidean distance between two colors is equal to their perceptual distances (for distances less than ~10 units). Algorithms that process color images often produce better results in CIELAB.

The equations implemented here come from Charles Poynton's Colour FAQ.

Cite As

Mark Ruzon (2021). RGB2Lab (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (13)


Is there a guide on how to use this?

hah ye


Syahirah Addenan

Thien Tran

Surachet Jurakurd


how exactly to use this file (to check if it works with some pic), sry for the question, but I am new in this and I need color space segmentation with Lab color space


This file is actually sRGB to Lab? sorry i am confused

Tim Zaman

This assumes an sRGB color profile, most certianly not always the case.

Faranak Sh

Thank You!

Tim Zaman

you can only successfully convert if you know what color profile [RGB] is used. I guess you took sRGB?

Abe Lau

I guess "makecform" is the native command Uwe was referencing to

Mark Ruzon

What native MATLAB implementation? I see lab2double but not the reverse.


I don't see the advantage over the native Matlab implementation.

To make it nicer, you should make the whitepoint and the colorspace selectable. (now it is D65 and sRGB).

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!