Photoshop help with blending layers

Discussion in 'General Discussion' started by Sxotty, Nov 16, 2011.

  1. Sxotty

    Veteran

    Joined:
    Dec 11, 2002
    Messages:
    4,870
    Likes Received:
    330
    Location:
    PA USA
    How can I blend/merge layers in photoshop giving equal weight to each layer regardless of layer order? It is really simple I just want to average the pixel color of the pixel in each layer.

    However I cannot figure out how to make it work any ideas? Or terms I should be searching for? It seems likely this functionality would be built into photoshop and I don't really have the skill anymore to write a program to do it, though it should be pretty darn easy to check the RGB value in a BMP file for each pixel location and average them.
     
  2. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    Is this what you are asking for?:

    Blend layers 1&2 together with weight = 0.5.

    Blend layer 3 on top of those with weight 1/3
    ..
    Blend layer N on top (of results of blended layers 1 thru N-1) with weight 1/N.
     
  3. Sxotty

    Veteran

    Joined:
    Dec 11, 2002
    Messages:
    4,870
    Likes Received:
    330
    Location:
    PA USA
    I was thinking of this being the value of a pixel in the same location in each layer.
    Code:
    1
    0
    256
    240
    200
    180
    
    I want the resulting blend to have the result (1+0+256+240+200+180)/6=146
    I think what you suggest is the same as long as the blend works how I think.

    (1+0)/2=0.5
    0.5*2/3+256*1/3=86
    86*3/4+240*1/4=124.25
    ...
    gives 146 as well. But is there a way to automate this? I don't want to go through 100 layers by hand doing something like this. Thanks

    Basically I could go through and blend in sets of 2 with opacity of bottom at 100% and top at 50% then blend the results of the blends as long as they are divisible by a power of 2. I cant believe there isn't a simple function to just average color through the layers though.
     
  4. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    Download netpbm?
     
  5. Zaphod

    Zaphod Remember
    Veteran

    Joined:
    Aug 26, 2003
    Messages:
    2,204
    Likes Received:
    103
    Write a script? (Caveat, I haven't looked at the scripting capabilities of Photoshop in ages.)
     
  6. Sxotty

    Veteran

    Joined:
    Dec 11, 2002
    Messages:
    4,870
    Likes Received:
    330
    Location:
    PA USA
    Thanks for you help guys, I don't know enough about scripting in photoshop to do it. I wrote a MATLAB program that will work theoretically, but I think it may run out of memory. IT has to open every bitmap as of now then it average the 8bit RGB values and spits out a blend. I would rather just read one pixel at a time out of each image so memory issues would not arise. Maybe I am being overly silly though. It might not be a problem and worked ok in a test of only images, certainly much faster than by hand in photoshop.

    edit:
    for 6 bmps it takes 2s to run the program about so it seems like it will be pretty fast as long as it doesnt crash.
     
    #6 Sxotty, Nov 16, 2011
    Last edited by a moderator: Nov 17, 2011
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...