Steve on Image Processing

September 9th, 2009

Many steps needed for some color-space conversions

It can take a lot of computational work sometimes to convert between color spaces. I was recently looking at the computational steps needed to convert between sRGB and a particular CMYK space known as US Web-coated SWOP, often just called CMYK SWOP.

The Image Processing Toolbox ships with ICC profiles corresponding to each of these spaces. If you give these profiles to makecform and applycform in order to convert sRGB color values to CMYK SWOP values, applycform will perform the following steps:

  1. Linearize the sRGB values using the red, green, and blue tone reproduction curves.
  2. Convert linearized RGB values to the sRGB profile connection space (XYZ) by multiplying by a matrix based on the red, green, and blue colorant tags.
  3. Adjust the black point to compensate for the difference between the ICC version 2 profile (sRGB) and the ICC version 4 profile (CMYK SWOP). (This adjustment is a scale and an offset.)
  4. Convert from the sRGB profile connection space (XYZ) to the CMYK SWOP profile connection space (Lab).
  5. Scale by (257/256) to adjust ICC version 2 16-bit Lab encoding to ICC version 4 encoding.
  6. Apply one-dimensional pre-shaper curves.
  7. Apply pre-matrix.
  8. Apply one-dimensional input tables.
  9. Perform three-dimensional tetrahedral interpolation using the multidimensional grid tables.
  10. Apply one-dimensional output tables.
Whew! That's a lot to track.

2 Responses to “Many steps needed for some color-space conversions”

  1. Doug Schwarz replied on :

    Is step 10 a secret? :-)

  2. Steve replied on :

    Doug—Oops, sorry about that! I left out the slash in a </li>.


MathWorks
Steve Eddins is a software development manager in the MATLAB and image processing areas at MathWorks. Steve coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.

These postings are the author's and don't necessarily represent the opinions of The MathWorks.