Wednesday, November 10, 2010

Photoshop Wishlist #1

I AM CURRENTLY evaluating Adobe Photoshop CS5 on my computer, and have 18 days left until the trial copy expires. For the most part, I am delighted by the product, and see many improvements over my old CS3 version. It does not require that much additional computer power — and sometimes it uses even less, since it uses the graphics processor and memory to do tasks once reserved for the main processor.

Photoshop is a venerable, highly developed and nuanced product, and like any complex, actively developed system that's been around for a long time, has many features which see little use nowadays, as well as the refinement to be able to do important things very, very well.

However, a highly developed system may find it difficult to adapt to new conditions, having been optimized for previous conditions. Photoshop has its roots as a raster image processor primarily for graphics arts professionals, and is well-known as a good platform for doing digital art, with its excellent support of many paintbrush-like tools for creating images from scratch. But it is also used in photography, as its name suggests. I am beginning to see some limitations of its photographic capabilities, and one major limit is that images are always strictly bound to an output medium.

For most Photoshop users, this limit means that you edit your images in the sRGB color space, with eight bits per color channel. That isn't too bad, and this is an obvious approach for 90% of all users: after all, that is the standard format used by most cameras and Internet web browsers. Certainly you would want to edit a file in the format which the camera delivers and what your computer can display. Photoshop does things the way it ought to be — right?

I see some problems with this. Each color channel has a maximum value of 255, a minimum value of 0, and we can use only integer steps between: 1, 2, 3, and so forth, with no intermediate values. This lack of precision is of little consequence to most users, and if you do need greater precision — for example, if you are applying severe curves to your image — then certainly you can use 16 bit mode (as I do) to increase the number of possible values. This extra precision helps avoid digital processing artifacts such as banding, and also lets you get better shadow detail.

CS5 has a great improvement over CS3 in that it allows far more operations on 32 bit images, giving us great precision in image manipulation; I haven't tried it yet, but look forward to experimenting with it.

But that isn't good enough. I'd like to see fractional RGB numbers. I want RGB values greater than 255.  I want negative RGB numbers. But this is madness! You cannot display an image with RGB values greater than 255! And what on earth are negative RGB values? Those are clearly impossible, there is no such thing as negative light!

But remember that I stated that in Photoshop images are always bound to a specific output medium, which for most photographer users is probably 8 bit sRGB. While clearly I do eventually want an 8 bit sRGB image, while I work on processing an image, there may be times when my intermediate files will be out of that gamut. And I do process my images mainly in the wide ProPhoto gamut — or in the ultra-wide L*a*b colorspace — with 16 bits per channel to overcome the limits of sRGB, at least temporarily.

Do not think of processing images as a step-by-step process, where each increment produces a superior image.  Sometimes you have to make an image look worse before you can make it look better. I propose making images so bad that they are impossible to print, or even view accurately on your computer monitor — at least temporarily.

For example, when I apply a severe curve to an image, anything that ought to go over 255 is set to 255, and so we lose information and image detail. However, if its value ought to be 300, I want it to be 300, even though it is out of the gamut for the time being.  If I tell Photoshop to make an image twice as bright, I want the entire image to be twice as bright, without worrying about losing highlight detail. I will deal with the gamut when I need to deal with it, which is when I'm preparing the final image for print or web display.

I often add together multiple images to make a final image. What I have to do is apply an opacity to each layer (which is like doing division) to get my final result, but certainly there must be severe rounding errors, and we are losing tremendous amounts of detail in the shadows as a result, which is a bad thing, and especially since digital photography is known for often having terrible shadows. What I would like to do is be able to add together images with impunity. Image addition, which is called Linear Burn in Photoshop, has a maximum value of 255, but if the final value of all this addition ought to be 500, that is what I would like to see.

Generally speaking, I would like to see in Photoshop a pure kind of image algebra, where we can do all sorts of operations on images in a way that follows the standard rules of arithmetic, such as add, subtract, multiply, and divide, as well as other more obscure operations such as exponentials. To do this accurately, we can't have the hard cutoffs of 0 and 255, nor should be we limited to mere integers.

This brings us to negative RGB numbers. These in fact can represent real colors. For example, if you work in a narrow-gamut color space similar to sRGB, and you want to represent a real color outside of its gamut, you can mathematically represent this if you are willing to allow at least one RGB number which is negative or greater than 255. So a negative RGB does not mean negative light, but rather that it is merely an out-of-gamut condition. If we are allowed to use negative numbers — and numbers greater than 255 —  then we will be able to represent all colors while still using a system that is otherwise identical to our narrow-gamut color system. This system will remain relative to a particular gamut, while not being limited to that gamut.

This has many benefits to a careful Photoshop user. If you work in the ProPhoto or Adobe RGB color spaces, and I know many people do, how then do you know that a particular color is out of sRGB gamut? Certainly you can turn on the Gamut Warning feature (I use it all the time), but how can you create a mask for this sort of thing? Can you tell, just by looking at an RGB value, that it is out of gamut? By using large and negative numbers, we can then precisely identify what is out of gamut simply by the numbers: is it greater than 255 or less than 0?

I often attempt to brighten shadows, and try to add lots of local contrast so that dark areas of an image still appear to be dark to the eye, yet in fact are not all that dark, and instead show lots of detail. This is often impossible to do well due to the arithmetical rounding errors found in low RGB values, which is a contributing factor to noise.  Ideally, a numerical representation of RGB would give equal precision to all levels of perceived brightness, but that is not what we currently have, as can be seen in the illustration below:

number of colors by brightness

Most of our current systems of numerically representing color are biased towards midtones, particularly saturated green and magenta tones, while offering a paucity of dark and bright colors. This gives us the risk of banding in our final image.  Having fractional RGB numbers would alleviate this problem greatly, and though we can use 16 bit images, having fractional values would give us a better guarantee of processing shadow values — and highly saturated dark colors — to avoid rounding errors.  I've noticed that 8 bit sRGB in particular handles navy blue rather poorly, which is a pity, for that is my favorite color. We always risk banding when we have large areas of dark blue, as is often found in brilliant deep blue winter skies, especially when using a polarizing filter. We see the same problem with bright yellow colors.

If you take an 8 bit image and convert it to 16 bit, Photoshop multiplies the RGB values so that they fill the new numerical representation. So a value of 255 will be converted to 32768, which is the maximum 16 bit number. In the 32 bit system, which uses floating point numbers, 255 is converted to 1.0, which is the maximum value allowed in that system: all smaller RGB values are some fraction less than 1.

Instead, I propose an alternative method. When you convert an 8 bit image to this new system, all values remain unchanged. The difference is that your values can, after processing, be greater than 255, less than 0, or some fractional number. With this system, you can be very careful, and never allow your image to go out of gamut, or you can edit to your heart's content and worry about gamut later. If you edit an sRGB image in the sRGB color space, your image may want to go out of gamut and you will never know it, except that detail will disappear.

There are a few problems with my system.  First, you can't see the extra colors if you don't have a wide gamut monitor, but we already see this problem when working in the Adobe RGB or L*a*b color space. The other problem comes when we want to convert a high-precision image back down to 8 bits.

The key to working with images in any gamut is to do by-the-numbers processing, and have a thorough understanding of the channel structure of the images. Instead of merely determining if an image looks OK on your screen, you instead measure an image to be sure the colors are right. Calibrating your images is more important than calibrating your monitor.

Converting an image back down to an output format like 8 bit sRGB is more problematic, but take a look at Photoshop's own conversion options from 32 bit images.

However, doing something like this may not work well within the Photoshop product, as it would require a major redesign of many features. However, I do think that it would be quite useful for accurate image processing.

No comments: