0
\$\begingroup\$

This question is about emulating Gimp's Grain Merge Blending Mode in Photoshop. As can be seen, it adds the layer above and subtract 128 (DC Level).

Why is it important? It creates the ability to use "Negative Numbers" in a layer limited to the range [0, 255].

I have more than 2 layers stacked one above the other.
I want to sum them yet since the represent negative numbers (They are in the range -128 to 127) I added 128 (I can add any other number) to all.

The problem I can't add them up in Photoshop.

I saw some math tricks people made to emulate averaging like here:

http://www.cambridgeincolour.com/tutorials/image-averaging-noise.htm

Is there such trick to emulate Grain Merge in Photoshop?

Thank You.

P.S. The Math Behind the Blending Mode might be useful:

\$\endgroup\$
3
  • \$\begingroup\$ Could you maybe create that effect using the Pixel Bender? \$\endgroup\$ Feb 18, 2015 at 12:32
  • \$\begingroup\$ Hi, I can also do it using Calculation, yet since I have more than 2 layers and I want to see the effect in real time (Adjusting each of the layers) I must do it using Blend Modes. \$\endgroup\$
    – Royi
    Feb 18, 2015 at 12:40
  • \$\begingroup\$ As far as I can tell from the documentation (I don't use Gimp), Grain Merge is a destructive application rather than a blend mode as such. If that is the case, Apply Image using Add mode with a scale of 1 and an offset of 128 (in 8-bit; 16-bit would be Subtract with a scale of 1 and an offset of 0 and the grain image inverted) would be the same thing. But it's not real-time. \$\endgroup\$
    – user35658
    Feb 18, 2015 at 18:03

2 Answers 2

1
\$\begingroup\$

Duplicate the layer and invert one copy. With the curves tool flatten the bottom half of the brightness range. Using the levels tool, on both layers, set the input levels to 127, 1.00, 255 and the output levels to 0,127 finally set the blending modes of one layer to "Linear Dodge (Add)" and set the other one to "Subtract".

What we have done is effectively isolate the the top half and bottom half of the brightness range, and then add one whilst subtracting the other.

\$\endgroup\$
4
  • \$\begingroup\$ That might work yet each layer would look "awkward" and hence harder to edit. I wonder, does Photoshop support "Negative" values in its 32 Bit Mode? \$\endgroup\$
    – Royi
    Feb 18, 2015 at 15:26
  • \$\begingroup\$ @Drazick can you explain more about the exact problem you're trying to solve. Overlay blending mode does a combination of Screen and Multiply depending on whether pixel values are greater or less than 127. If you're not after a mathematically precise result it may work. \$\endgroup\$
    – Matt Grum
    Feb 18, 2015 at 16:12
  • \$\begingroup\$ Is there a combination of Add and Subtract? I'm trying to accumulate information from many layers. Yet it is both negative and positive. Hence I need something like Grain Merge. \$\endgroup\$
    – Royi
    Feb 19, 2015 at 9:52
  • \$\begingroup\$ I marked the answer as "Correct Answer" though it is not exactly as I wanted (See my answer below). Yet it would work. I'm still looking for a proper solution. I think it can be done with prior scaling and using "Linear Light" or "Linear Burn" as can be seen according to: simplefilter.de/en/basics/mixmods.html \$\endgroup\$
    – Royi
    Feb 21, 2015 at 20:50
0
\$\begingroup\$

There's a way to do so in 32 BIT.
In 32 Bit Mode Photoshop doesn't clip the subtraction between layers.

I'll try to explain.
Imagine 3 layers, the bottom layer, layer #1 has constant value of 120.
Layer number 2, above it, has a constant value of 130 and it blending mode set to Subtract.
The top layer, layer #3, has a constant value of 10 ans its blending mode is set to Add.

In 8 Bit and 16 Bit the result, Composite Layer, would be 10 as the subtraction result is clipped into 0.

In 32 Bit Mode the result is 0, as there is no clipping.

Hence What I asked for could be done by adding the same number of layers with constant value of 128 at Subtract Blending Mode (Actually one could be created with the value of # Layers * 128).

I'm still looking for a solution in 8 / 16 Bit Mode.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.