Accurate Image Manipulation for Desktop Publishing 
Photoshop

Testing Color Modes Changes

For testing Adobe Photoshop (or any other sw) for color mode changes, please download the rgb_gamut.zip. The zip file is only 78kB in size, but it contains the rgb_gamut.psd image that is 4096 * 4096 pixels in size. This image contains all the 16,777,216 colors of the RGB gamut, one pixel per a color. 

It is really an amazing compression ratio for a zip-file. 78kB zip contains the 17.5MB rgb_gamut.psd that in turn will expand into 50MB RGB image when saved as BMP. Btw: my system is only a K6/200 with 32MB RAM and I have had no problems with the image size.   

Some results

Lab Space:  

Image/Mode/Lab followed by Image/Mode/RGB will reduce the initial number of colors from 16,777,216 down to 2,220,769. In other words the colors are reduced by the factor of 7.6. This depends a little on the "Monitor Gamma" setting. The "Monitor Gamma" also affects to the color shifts, two cases about this: 

First Monitor Setup:  
Gamma:2.2, WhitePoint:6500K, Phosphors:Trinitron, Ambient:Medium  

Red shift:   -30 ... +31  
Green shift: -15 ... +26  
Blue shift:  -14 ... +23  
Colors left:   2,130,771  

Second Monitor Setup:  
Gamma:1.0, WhitePoint:6500K, Phosphors:Trinitron, Ambient:Medium  

Red shift:    -5 ... +5  
Green shift:  -4 ... +3  
Blue shift:   -5 ... +4  
Colors left:  1,638,709  

Note that the color shift is transferred into the CMYK since Photoshop converts color modes through the Lab space. 

CMYK space  

Image/Mode/CMYK followed by Image/Mode/RGB will reduce the initial number of colors from 16,777,216 down to 604,976 ... 705,000. Here the colors are reduced by the factor of 27.7. This possibly depends on the calibration setting of the system so your mileage may vary a little. The theoretical maximum seems to be 101*101*101 =  1,030,301 colors in the CMYK space since the color components are rounded into integers ranging from 0% to 100%. 

In comparison, when the rgb_gamut image is saved as Jpeg using compression ratio 5 in Photoshop the rgb_gamut.jpg will still have 2,400,000 colors. 

How to Count Unique Colors in an Image

    Photoshop can not calculate the unique colors used in an image, so another tool has to be used. For example PaintShop Pro a shareware can, there may be others but I have no knowledge about them. PaintShop Pro calculates the unique colors accurately and it can open large *.BMP files decently fast. 
Please note: 
    Although PaintShop Pro possibly can open *.PSD images, it may be rather slow  in opening the large rgb_gamut.psd into PaintShop Pro, so open it into Photoshop and when you wish to calculate the colors of the image use File/Save_a_Copy to save a copy as *.BMP. 
    For e.g. if you wish to verify the amount of the colors in the rgb_gamut.psd, open it into Photoshop and immediately choose File/Save_a_Copy and save a BMP file like rgb_gamut.bmp. Then open the rgb_gamut.bmp into PaintShop Pro and choose Colors/CountColorsUsed. After a while PaintShop Pro will show a dialog that tells you the amount of unique color in the image, 16,777,216.

How to evaluate the color shift

    open the original rgb_gamut.psd 
    save a copy on another name 
    open the copy  
    do some mode changes (like RGB to Lab, then Lab to RGB)
    Then do Image/Calculations between the original and altered images, (this is done three times once for each primary colors channels red, green and blue), using the Subtract mode with scale at 1 and offset at 128. (The level 128 will be the new base level so that errors in both direction can be detected). Choose to have a new image as the result.
    Then verify that the image zoom of the new image is 100% or more. This is due to a "feature" in Photoshop, the Image/Histogram is not accurate at zoom levels below 100%. Or un-check the "Use Cache for Histograms" check-box in the File/Preferencies/Memory&ImageCache dialog.
    Then inspect the errors from the new image using the Image/Histogram. Using the mouse it will show the current level below the mouse and the amount of pixels having that level. Please remember that level 128 is the base level (indicating no error on that component of the RGB color). 

Accurate Image Manipulation for Desktop Publishing 

Copyright Timo Autiokari, 1997-2007. Contact info