File Exchange

image thumbnail

Computational Colour Science using MATLAB 2e

version (1.19 MB) by Stephen Westland
Colour toolbox that accompanies the second edition of Computational Colour Science using MATLAB


Updated 05 Mar 2013

View License

Colour toolbox that accompanies the second edition of Computational Colour Science using MATLAB (Westland, Ripamonti and Cheung, 2012).

Toolbox allows spectral interpolation, calculation of colour coordinates, colour difference, colour appearance etc.

Cite As

Stephen Westland (2021). Computational Colour Science using MATLAB 2e (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (30)

Roger Breton

Had a "hard time" entering data for the Camera Characterization, page 131 from the 1st edition.
There are three variables, r, g and b, that, to my understanding, are supposed to represent the "normalized" (0 to 255) RGB counts.
The code show these r, g and b variable this way :
r = RGB(1,:)/255;
g = RGB(2,:)/255;
b = RGB(3,:)/255;

I am totally new to Matlab and have difficulty wrapping my head around the notation.
I program in c# and have no problem with programming concepts such as data types.
But, here, as much as I tried to execute de "division" operation (divide the content of each RGB 8bit values by 255, the code kept returning *only* the first "row"?

So, is there like "list of errors" I could download anywhere?

Lang Hu


What is rgbwr in the code?

Théo Le Carpentier

Xiangwei Yi


Very useful. Thanks for contributing the code here.


Teresa Rotava

Reqq Aljawfi

Jae Sung Park


Yu-Cheng Hsu

Zhuangzhi Zhang




Respectfully, but I agreed with Jueqin. The ciecam02 function seems an unfinished revision to a previous ciecam97s function. Also some typos in the corresponding section in the book. Hope this can be fixed in future version.

federico ferraresi

s k

I do not understand the function of the input variables ciecam02
please guide me

Dmitriy Ovcharenko

sad, this toolbox is without GUI

Michael Cheng


Jueqin Qiu

ciecam02.m function seems goes wrong?

Bill Zhou

I have the same question as sunx's

Pengfei Wang

Great Job!


In the cieplot() function, it was assumed Y = y when the colors are transformed to sRGB, which resulted in darker color than most other CIE 1931 plots on the web, especially in the lower part of the graph. I'm wondering what should be the Y value for the different regions.


Do you have the data files used in this book. It will help follow the steps for colour calculations and interpretations.


I could not find the cc.tif file. Could you update with the file.

Beth Cummings

I'm trying to use the Colour Constancy example on pg 181, section 12.2.1, which requires camera.mat, but camera.mat is not in the v1.3 .zip folder.

Also cc.tif which is used in the camera_demo.m script is not in the .zip folder


t py

Stephen Westland

The latest version of the toolbox is v1.3 uploaded on 5th March 2013.

v1.2 was introduced on 31st July 2012 and corrected a small typo in the code cie00de.m.

v1.3 corrected an error in the sprague.m code which resulted in some problems with the interpolation method.

MATLAB Release Compatibility
Created with R2012b
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!