Dan Margulis Applied Color Theory

The Calculations Command

   Date: Thu, 3 Nov 2005 06:56:23 -0600
   From: Howard Smith
Subject: Calculations

Here's the Calculations information that I promised to give to Richard Sallee. Maybe a few of the others here can make use of the information as well.  Enjoy!

Both the name and the dialog box of Calculations almost appear to be designed to discourage new users. The truth is that this tool is easy to understand, easy to use, and can provide hours of entertainment if you have the time to work with it. If you've already read the Apply Image post, you have about 90% of the information you need to understand it. The other 10% is in this post. As for using it, you're going to find that using it is remarkably similar to using layers. Its just a lot more versatile in several respects.

So how is Calculations similar to layers? Well, its use is not similar to all uses involving layers. Just to cases where you are blending one layer with another. Calculations does exactly the same thing you do with layers except that it blends one channel with another instead of blending one layer with another. Unlike layers, it takes the results of your blending and gives you a choice of three different destinations for the blended results, including putting it in a new channel in the same file. Wouldn't it be handy to be able to do that with layers? Not only that, it gives you the option of inverting either or both of the channels, gives you a choice of even more blending modes than you find for layers, and permits you to use a mask to further refine the results. And, finally, it shows you a preview which permits you to change your choice of channels, blending mode, and mask before you accept the results. What more could you ask when you need to blend one channel with another?

But why would you want to blend one channel with another? If you don't know, not only have you not read any of Dan's books, you haven't read Katrin Eismann's book on compositing and masking, either. For that matter, if you don't know why you would ever want to do any channel blending, you don't need to read any further. You don't need to know anything about Calculations.

But let's suppose you do want to be able to do channel blending. You can do it the hard way (you can do just about everything in Photoshop the hard way), or you can make use of Apply Image and of Calculations. Each has its own role. You know how to use Apply Image. Now you're going to find out how easy it is to use Calculations.

Open an image and choose Image/Calculations to open the Calculations dialog box.

First you are asked to choose Source 1 and Source 2. Each one give you the option of selecting any open file and choosing a channel from it (any channel but a composite channel). You can choose one channel from a LAB file and another channel from an RGB file, or you can choose the same channel for Source 1 and for Source 2 (remember that you sometimes blend one layer with itself; same idea). For each Source, you must choose the name of any open file, the layer that contains the channel you want, and the channel that is represented in that layer. The color spaces are irrelevant to Calculations, but it does demand that both files be exactly the same size and the same resolution. This was covered in the Apply Image post.

But which channel goes into Source 1 and which goes into Source 2? That's up to you.

When you blend Source 1 with Source 2, the priority is identical to the case with layers.

The top layer has priority over the underlying layer. The top channel (i.e., Source 1) has priority over the underlying channel (i.e., Source 2). Put more simply, choosing Normal as the blending mode at 100% opacity will produce a result that is exactly the same as the Source 1 channel. The Source 1 channel will cover up the Source 2 channel so that all you see in the new channel is a duplicate of Source 1. Either the top layer or the top channel has a dominant position when it comes to blending. Now this leads to another confusing turn of events. How do you know which blending mode to choose for a specific pair of channels when you need a specific result? Well, you can memorize all the definitions of blending modes and then beat your head against the wall twenty times (twenty-five times if you have a hard head). When you are finished, you go with your instincts and choose the channels and the blending mode you think might work. If they don't, you've learned what won't work. Just try again with another combination, once again being guided by your instincts. Just like Apply Image, with experience you may get a feel for certain blending modes for certain conditions, but don't count on being right very often. The examples used by some authors lead you to believe that they were shrewd enough to make the correct choices the first time every time. Dan is the only one with enough confidence to freely admit that some of his best results are at least partly the result of trying different combinations. When you do find a combination that works, make a note of it. You may want to try it again on other images. Eventually you'll probably have a collection of combinations that work with problems you encounter again and again. At least they provide a good starting point for experimentation.

What about the mask? You use the same procedure to choose a mask that you use to choose the channels for Source 1 and for Source 2. The mask only affects the top channel (Source 1), not the underlying channel or the result of the blending operation.

Your best overall approach is to look at the channels of files in several different color modes and pick out the ones you think will get the job done for you. You put these choices into the dialog box as Source 1 and Source 2, then you pick out the blending mode that you feel would work best. If the combination doesn't work, try another blending mode and try inverting either or both channels. Consider using a mask for Source 1. And of course consider using Curves to edit the new channel that results from your work. And you've always got the option of inverting the new channel. How much more flexibility could you want?

If you choose the New Channel destination option, your new channel becomes an Alpha channel that can be blended into one of the color channels or used as a mask. If, for example, you have a Curves adjustment layer accompanied by the default blank layer mask, you can use Apply Image to paste the new channel into the Curves layer mask. Naturally you are not limited to just one New Channel. You can accumulate as many results as you need. Each Calculations result is stored in a separate channel.

If you're still puzzled, open any image and make two duplicates of it. Change the modes of all three files to different color spaces. Now, choose any two channels and open the Calculations dialog box. See what happens with different channel choices, different blending modes, different opacities, and different arrangements (make channel "x" Source 1 and make channel "y" Source 2. Then do another Calculations operation and swap the channels used for Source 1 and for Source 2).

Now, it may well be that someone on the Forum knows a formula or rule for making the correct choices every time. If they do, I hope they are willing to share the secret. Very few of the books in my extensive collection of Photoshop books even do more than briefly mention Calculations. Makes one wonder just how many of them even know where to begin. The only exception is Photoshop Channel Chops co-authored by David Biedny, Bert Monroy, and Nathan Moody. This book goes into great depth about Calculations, but it is a depth that you don't need to explore if you just want to do some advanced channel blending with this formidably named but very easy-to-use tool. If you are writing a Photoshop book and want to sound terribly experienced, this little book will be an essential reference. You could memorize their concise but detailed account, but you're still not going to be able to predict the outcome when you blend any two channels. If you're not willing to experiment, Calculations is not going to be of much use to you.

Curves, layer masks, Apply Image, and Calculations are probably the most formidable tools in Photoshop. Now you know that it's easy to understand how to use each of them, but you'll only become expert with them by using them. The longer you work with them, the more uses you will find, and the better you will become. Intelligence, knowledge, and experience are not the same things. Each one needs the others.

Howard Smith
___________________________________________________________________________

   Date: Thu, 3 Nov 2005 20:04:33 -0600
   From: "Maris V. Lidaka Sr."
Subject: Re: Calculations

Howard,

Thank you very, very much for both posts - exceedingly informative.  They're
keepers!

Maris
___________________________________________________________________________

   Date: Mon, 7 Nov 2005 18:01:17 -0600
   From: Howard Smith
Subject: Re: Calculations

Thanks for the encouraging reply!  To me, this kind of represents the whole idea of this forum--to help those who are still struggling with the hardest part of Photoshop, the basics.  Once we get past all those confusing definitions and stern warnings, it turns out that Photoshop is not only profitable but highly enjoyable.  Had it not been for the generous help offered by others here, I would be one of those still struggling with the onerous basics.  Still don't know much, just enough to recognize that there's still hope.

Howard Smith