For example, if two grayscale images, one with a
intensity and the other with b
intensity, are added the resultant image should be of a + b
intensity.
2 Answers
As with almost anything in Photoshop, there are several ways to do this, depending on what fits your needs and your workflow.
Among the Blend modes, Add is called "Linear Dodge". It says that, in fact, right in the menu. You can, therefore, place your images one above the other and apply Linear Dodge to the upper one. All of the "Lighten" Blend Mode group are variations of Add, but Linear Dodge is a straight arithmetic operation. All of the calculations involved in the different blend modes are documented here.
If you are specifically looking for grayscale output, Calculations (Image > Calculations
) has been around since the Pharaohs, or thereabouts. This allows you to (among many other things) Add two channels to create either a new channel or a new grayscale document. This works across images, not just with layers. The two images must have exactly the same size pixel dimensions.
Calculations is unique in that it can take the gray values of an RGB image and blend them with the gray values of another RGB image to produce a grayscale output.
Another that's been around since Noah is Apply Image. Once again, Image > Apply Image
can be used with two channels in one document, a channel with the RGB composite "channel" of the same document, or either of those across two documents of the same dimensions. It's different from Calculations because it does not create a new channel or document, and its output will be in a color mode if applied to a color composite.
-
You can also do this with masks etc. but i think 3 ways is good enough.– joojaaNov 18, 2014 at 16:23
-
The rest, as they say, is left as an exercise for the reader... (Calculations or Apply Image rock for creating masks.) Nov 18, 2014 at 16:31
-
If you have two grayscale images, then multiply will do the trick. Except you should understand, that there is a limit to that. Max intensity is 255, so if on first layer intensity is 150 and on second the same, resulting intensity will be only 255, not 300, because it's technically impossible.
-
1Multiply is a multiplication operation, not addition. When image values are added, the image becomes lighter. Multiply always results in a darker image unless the layer is pure white or pure black. Nov 18, 2014 at 17:10
-
Question was about calculating sum of two image intensity, in this case multiply is the best choice.– mrsergeNov 18, 2014 at 17:19
-
1Um, no. The question is "how do you arithmetically add two images". Intensity could have a variety of meanings in this context, but since the OP is a Stack Overflow and SU user, he's probably a developer. I'm willing to bet he means exactly what the question says. Nov 18, 2014 at 18:12
-
1Intensity could mean highlights, contrast, shadows, or gamma depending on what you're trying to achieve. Nov 18, 2014 at 22:45
-
1@mrserge you mean addition result more than 255 truncating to 255? I know that. :) Thanks. Nov 19, 2014 at 16:58
Screen
orMultiply
blending modes does not fit your needs?