Add two layers pixel-wise for all channels in Photoshop

Discussion in 'Photoshop Tutorials' started by d99alu, Jan 1, 2006.

  1. d99alu

    d99alu Guest


    I'm looking for the simple operation to add two layers pixel-wise for
    all channels in Photoshop (ver. 8). I find adjustments layers and
    blending options for Multiply, Difference and so on, and I find
    Arithmetic's for adding in gray scale and separate channels, but all I
    want to do is just to add two layers pixel by pixel for all channels.
    That is:
    out_image = in_image_1 + in_image_2

    I also would like to do the simple operation
    out_image = input_image * k + m

    I have been searching the net for quite some time, if anyone could give

    me a hand here, that would be most appreciated.

    Andreas Lundgren - Sweden
    d99alu, Jan 1, 2006
    1. Advertisements

  2. d99alu

    Bill Hilton Guest

    Andreas Lundgren writes ...
    You can usually figure out a way to do operations this by getting the
    actual formulas for the various blending modes and figuring out how to
    apply them. For example, the formula for the "Add" mode is ((source 2
    + source 1)/scale) + offset => destination ... so with scale = 1 and
    offset = 0 you'll get what you need ... access this command in
    Photoshop CS with Image - Apply Image, the defaults for scale and
    offset are already set to 1 and 0 ... this will do the trick.
    Did you mean (input_image * k) + m or input_image * (k+m) ? Either way

    I think you can figure this out with the blending mode formulas too,
    though the straight 'multiply' command is ((source 1) x (source 2))/255

    so you may need to combine multiple operations ... if you just multiply

    without the divide-by-255 you'll quickly get far too much black ...
    Hope this helps ... try to find a list of formulas for the blend modes
    (I got mine from the "Photoshop Artistry" books) and realize you might
    need to run two operations to get the result you want and it should
    make sense.

    Bill Hilton, Jan 1, 2006
    1. Advertisements

  3. d99alu

    Bill Hilton Guest

    if you just multiply
    oops, change 'black' to 'white' :)
    Bill Hilton, Jan 1, 2006
  4. d99alu

    d99alu Guest

    Thanks Bill!
    d99alu, Jan 1, 2006
  5. d99alu

    Mike Russell Guest

    Hi Andreas,

    Use the "Add" blending mode for Image>Calculations. Add supports a scaling
    factor, which you may use, with a little trickery, to get your second
    result. Start with a black image, and perform two add operations, one with
    the scale value K and one without. The scale factor may also be used to
    prevent overflow after an add operation.

    You will need to repeat the calculation for each channel - record these
    operations into an Action.
    Mike Russell, Jan 1, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.