View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.0 | 7 ratings Rate this file 19 Downloads (last 30 days) File Size: 158 KB File ID: #19706 Version:
image thumbnail



Brett Shoelson (view profile)


24 Apr 2008 (Updated )

Simple utility to view all color planes, grayscale, and colorspace conversions of an RGB image.

| Watch this File

File Information

Takes as an input an RGB image (or the name/path of an RGB image) and creates a figure in which you can see side-by-side the original, the grayscale (RGB2GRAY), and the individual R,G, and B color planes.
Advanced mode also displays some colorspace conversions (HSV, YCbCr, L*a*b*) of the image.
Click on any image to expand it and then right-click to export image to base workspace.

Shift-Click to generate Command-Line MATLAB code!

This is a very simple but useful utility for deciding, for instance, how you want to process/segment a color image.


Expand Axes(Hndls,Rot Enable) inspired this file.

This file inspired Image Toolbar.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.6 (R2008a)
MATLAB Search Path
Other requirements For full benefit, also download:
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (16)
12 Nov 2013 Brett Shoelson

Brett Shoelson (view profile)

Nithya, "actual luminance" is a bit hard to pinpoint in this sense, but perhaps the closest you can get to the "definition of luminance" is:

cform = makecform('srgb2xyz');
xyz = applycform(rgb,cform);
lum = xyz(:,:,2);

This is a "relative luminance." That is, it is a luminance with respect to a reference white. The reference white can be adjusted by using the 'WhitePoint' parameter to makecform.


Comment only
12 Nov 2013 Nithya

Nithya (view profile)

Is the luminance from YCBCR the actual luminance. In case of hdr image(from 5 ldr images)can this be used to find the actual luminance data from this method.

Comment only
17 Oct 2013 Xidian NO.1


16 May 2013 Brett Shoelson

Brett Shoelson (view profile)


[Note: MM indicated to me in an email that he was getting "file 'file_open.png' not found" errors.]

I verified that 'file_open.png' is included in the zip. Would you please download the submission again and ensure that all files are on your MATLAB path?


Comment only
16 May 2013 M M

M M (view profile)

It doesn't seem to work for me...

07 Apr 2013 Suraj Kamya

Suraj Kamya (view profile)

Although converting images in to different forms is very easy. But way you represent in GUI is very nice.

10 Mar 2013 Brett Shoelson

Brett Shoelson (view profile)

Please see my comment of 18 Oct, 2010.
Thanks, Brett

Comment only
09 Mar 2013 Pasha Mahmoudzadeh

Error in exploreRGB (line 176)

I dont know why I got the following error, otherwise you did great job!!!

Undefined function 'expandAxes' for input arguments of type

Error in exploreRGB (line 176)

28 Oct 2010 Yufei

Yufei (view profile)

22 Oct 2010 J.Paul Rinehimer

Brett -
I found explore RGB because I was attempting to replicate your code on Steve's blog.

Comment only
18 Oct 2010 Brett Shoelson

Brett Shoelson (view profile)

PLEASE NOTE: To use the new version, you will need to EITHER download EXPANDAXES ( OR comment out the corresponding line (line 173). (I recommend the former!)

Comment only
18 Oct 2010 Brett Shoelson

Brett Shoelson (view profile)

As of today, the new code is live herein. Thanks for the interest!

Comment only
12 Oct 2010 Brett Shoelson

Brett Shoelson (view profile)

Hi all,
A few people have contacted me to let me know that this version is not the same as that shown on my guest blog on "Steve on Image Processing." I'm not sure why this function wasn't updated, but I recently re-submitted my modifications; it should be up shortly. In the meantime, if anyone wants to email me directly at char(cumsum([98 16 -13 15 0 -70 69 -11 7 -10 7 7 -4 -1 -46 45 -12 19 -12 15 -8 3 -7 8 -69 53 12 -2])), I will be happy to send the updated file via email.

Comment only
09 Oct 2010 Brett Shoelson

Brett Shoelson (view profile)

Hi Paul,
Thanks very much for drawing my attention to this problem. The file is marked with a modification date of 6/21/10, but the associated code predates that. I don't know why that is, but I will look into how that happened, and I will make sure to put the more recent code on the File Exchange. In the meantime, I would be more than happy to email you a copy of the updated version of exploreRGB. (Just let me know.)
By the way, how did you happen to find your way to exploreRGB today, if you don't mind my asking?

Comment only
08 Oct 2010 J.Paul Rinehimer

Great function, except the "mode control" does not seem to be in the updated code. The file I downloaded only has a date of 4/24/2008.

02 Sep 2008 Eric Dick

I love this. This is a great tool for showing people RGB concepts. I love how this displays the images in such an elegant layout.

18 Feb 2010 1.2

Expande "mode" control--now allows 'Simple" mode, with suppression of export capabilities, and 'Advanced' mode, with additional viewing of HSV, LAB, and YCbCr conversion spaces.

04 May 2010 1.4

added copyright

21 Jun 2010 1.6

Updated M file and license text file copyright to The MathWorks, Inc.

12 Oct 2010 1.8

Somehow, my previous attempt to update to include "advanced mode" failed. Trying again. Also, changing the image to show advanced-mode.

02 Feb 2011 1.9

2/1/11 Minor modification to provide a handle to the window; facilitates closing or referring to exploreRGB window.

28 Mar 2013 1.10

Better image import, better exportability, better default behavior...

28 Mar 2013 1.11

Now incorporates toggling from normal to advanced mode, to show or hide colorspace conversions.

14 Nov 2014 1.14

Now includes Shift-click capabilities to generate MATLAB code at the Command Line!
Also, call customGray directly from ExploreRGB.
Verifies R14b readiness.

01 Sep 2016

Updated license

Contact us