File Exchange

image thumbnail

RGB2Lab

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

19 Downloads

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.

Comments and Ratings (11)

Thien Tran

Atanas

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

Hyunsung

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.

Uwe

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

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor