Wednesday, February 15, 2012

Convert sRGB to Lab color using recommendation of rec.709 display (Using ICC profile)

Problem: 
I need to convert an image from sRGB color space to Lab color space following the recommendation of 709 EBU display.

Approach: 
We will use the ICC profile of a 709 EBU display. The following process is also true for any other ICC profile.

Why do we need ICC profile?
Because, ICC profile gives us the detail standard such as the red, green, blue colorant matrix as well as TRC (tone reproduction curve). We will also use the media white point.

What files do we need?
  1. ICC profile file (ITU-RBT709ReferenceDisplay.icc) [can be downloaded from color.org]
  2. Any image to test
  3. A simple matlab function such as this (srgb2lab_by_profile.m) [Go to link & Click download]
Download the above mentioned files and try the following command in matlab
>> I_lab=srgb2lab_by_profile(imread('peppers.png'),'ITU-RBT709ReferenceDisplay.icc');
You can view the luminance channel by 
>>imshow(I_lab(:,:,1))
L channel after converting to Lab color from sRGB color





No comments:

Post a Comment

Please ask if anything is not clear enough..........