Trying to Deal With Color Integrity in Photoshop
Adding Black and Adding White in Photoshop
When we try to "add black" or "add white" in Photoshop we immediately run into a problem. The (R,G,B) values are typically (almost always) "gamma-encoded." To really understand the reason for this requires mathematics, but the gist is that traditionally most digital images have been 24-bits per pixel (which is the same as 8 bits/channel). When pixel values are expressed directly in terms of light intensities for each of red, green, and blue and crammed into 24 bits many visible colors get pushed out the edges and are lost. To cram the pixel values into the 24 bits without losing visible colors the pixel values had to be compressed, the same general idea as compressing zip files. This was done using a process called gamma-encoding. Gamma-encoding was convenient because it was already in widespread use in the analog video world for an entirely different reason. Unfortunately, Photoshop and most other image editing programs generally try to work directly on the encoded pixels rather than on the intensity values that they represent. Sometimes this actually works satisfactorily. Often, and to varying degrees, it does not. Unlike the earlier days, Photoshop now offers the capability for images to have more than 24 bits per pixel. Although this makes gamma-encoding unnecessary Photoshop still uses gamma-encoding in almost all cases and worse, still works directly on the encoded pixels.
One place where working on gamma-encoded images does work satisfactorily in many cases is with "adding black." Photoshop has several tools which perform a function equivalent to adding black, but none of them are obvious. The preferred tool is Levels, where the "highlights" portion of the tool does the correct action of adding black or removing black over much of its range. The shadow and mid-range functions of Levels destroy color integrity and are to be avoided.
The fact that Levels highlights control will work to properly add or remove black from a gamma-encoded image is pure serendipity. Although most working profiles are gamma-encoded, some such as sRGB are not and other new working profiles are coming into use which use L* encoding rather than gamma encoding. For these profiles, Levels highlights does not accurately function to add or remove black.
When we try to "add white" the situation is considerably worse. The Levels shadow or blackpoint tool might have served this purpose just as the Levels highlight tool will correctly add and remove black in many cases. But the Levels shadows tool works directly on the gamma-encoded image and in this case it simply does not work, often destroying color integrity quite noticeably. For digital camera images the ACR (Adobe Camera RAW) plug-in "shadows" slider (earlier versions) or "black" slider (later versions) appears to make the correct adjustment for removing white, but it does not provide for adding white or for working with tinted white. You might think that putting in a separate layer of white and then adjusting its percentage transparency should work, but the additions of layers appear to be done to the already gamma-encoded image, so even that does not work (see at the end of Color Integrity from the Viewpoint of Basic Physics and Mathematics for details on this). Technically it would be possible to convert the gamma-encoded image to a "linear" image, make the "add white" adjustments and later convert back, but that is tedious. It depends upon Photoshop to correctly convert the image encoding twice as well as making the adjustment for adding white, all without applying hidden "improvements" along the way, never a good bet. To avoid what baggage might be hidden in a "profile conversion" one could choose to do the gamma-encoding and decoding using the Levels middle-gray adjustment which is widely known to be a gamma adjustment. But Levels middle gray deviates from being gamma and the deviations are greatest just where they will do the most harm to this decoding-encoding. (See Color Integrity CFS-243 page 18 for details.) Hidden somewhere among the plethora of Photoshop tools there may be one or two that are capable of adding or removing white accurately, but as I write this I have not found any.
Also as I write this the ColorNeg and ColorPos plug-ins do correctly add and remove black with the "lightness" slider and do correctly add and remove white with the "shadow" slider. Technically when adding white with the shadow slider you also need to add a little black with the lightness slider to account for the colored areas that the white "paint" covers. In the future ColorNeg, ColorPos and perhaps a new plug-in will make more complete use of what has been learned in the study that led to this web page.
Perspectives and Comments
Genesis of the Idea what led to the discovery of these simple facts.
Why We Give Few Illustrative Examples of Color Integrity
Color Integrity from the Viewpoint of Artistic Painting.
Fog Example
Color Integrity from the Viewpoint of Basic Physics and Mathematics.
Trying to Deal With Color Integrity in Photoshop
Color Integrity and Color Balance A Few Examples
Comments on Calibrating Digital Images
"Acceptable Accuracy" in Calibration
Calibration and Color Profiling
The Pitfalls of Using Profiling as Camera Calibration
Much of the material in this document and the analyses are original with us. This document is
Copyright © 2009 by C F Systems
If you plan to use our original material or analyses in any published form, please contact us at www.c-f-systems.com for terms and conditions. Before-the-fact terms typically require no more than appropriate acknowledgement.
Privacy Policy and E-Mail
Go to C F Systems Home Page