Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 16-Nov-2011, 13:05   #1
Sxotty
Senior Member
 
Join Date: Dec 2002
Location: Under a Crushing Burden
Posts: 4,297
Default Photoshop help with blending layers

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.
__________________
You bought horse armor didn't you?
Sxotty is offline   Reply With Quote
Old 16-Nov-2011, 14:09   #2
Simon F
Tea maker
 
Join Date: Feb 2002
Location: In the Island of Sodor, where the steam trains lie
Posts: 4,396
Default

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.
__________________
"Your work is both good and original. Unfortunately the part that is good is not original and the part that is original is not good." -(attributed to) Samuel Johnson

"I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." Alan Kay
Simon F is offline   Reply With Quote
Old 16-Nov-2011, 14:52   #3
Sxotty
Senior Member
 
Join Date: Dec 2002
Location: Under a Crushing Burden
Posts: 4,297
Default

Quote:
Originally Posted by Simon F View Post
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.
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.
__________________
You bought horse armor didn't you?
Sxotty is offline   Reply With Quote
Old 16-Nov-2011, 19:36   #4
Simon F
Tea maker
 
Join Date: Feb 2002
Location: In the Island of Sodor, where the steam trains lie
Posts: 4,396
Default

Quote:
Originally Posted by Sxotty View Post
But is there a way to automate this? .
Download netpbm?
__________________
"Your work is both good and original. Unfortunately the part that is good is not original and the part that is original is not good." -(attributed to) Samuel Johnson

"I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." Alan Kay
Simon F is offline   Reply With Quote
Old 16-Nov-2011, 22:58   #5
Zaphod
Remember
 
Join Date: Aug 2003
Posts: 2,041
Default

Quote:
Originally Posted by Sxotty View Post
But is there a way to automate this?
Write a script? (Caveat, I haven't looked at the scripting capabilities of Photoshop in ages.)
Zaphod is offline   Reply With Quote
Old 16-Nov-2011, 23:11   #6
Sxotty
Senior Member
 
Join Date: Dec 2002
Location: Under a Crushing Burden
Posts: 4,297
Default

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.
__________________
You bought horse armor didn't you?

Last edited by Sxotty; 17-Nov-2011 at 00:22.
Sxotty is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:58.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.