What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Custom blending modes... is it possible?


guyboy

New Member
Messages
3
Likes
0
Is it possible to create custom blending modes for Photoshop CS5?
Because I'm looking for a way of merging two images with formulae. For example like this:

R = G₁/4+B₁/4+R₂/2
G = R₁/4+B₁/4+G₂/2
B = R₁/4+G₁/4+B₂/2

R, G and B being pixels color components of the output image, and R₁,B₁,G₁ and R₂,B₂,G₂ being those of the first and second input images respectively.

Is there any special software that can do this?
 

UsazyCypECype

New Member
Messages
1
Likes
0
boudoir

I am looking to do a photo book about the top 20 classy female models from 1970 to now. Would love suggestions and or feedback.
 

SCTRWD

Power User
Messages
457
Likes
239
It is possible.
First - divisions:
To divide first image by 4 use Curves adjustment with two points: (0,0) and (255, 64).
To divide second image by 2 use Curves adjustment with two points: (0,0) and (255, 128).

Now - to sums:

Create new image, fill it with black.

Go to Red channel and invoke Image->Aply image... For Source choose first image, Green Channel, Blending - Add. Click OK.
Again invoke Image->Aply image... For Source choose first image, Blue Channel, Blending - Add. Click OK.
And again: Image->Aply image... For Source choose second image, Red Channel, Blending - Add. Click OK.

Go to Green channel and repeate the same steps with proper sources and channels.
And the same with Blue channel.
 

guyboy

New Member
Messages
3
Likes
0
Ah, thank you! I didn't know about those divisions.
But I'm not sure how I'm supposed to do this:
The formula is to extract a transparent object that has been rendered on two different backgrounds.
Image intensity = (B₁*R₂ - B₂*R₁)/(B₁ - B₂)
Transparency = (B₁ - B₂ - R₁ + R₂)/(B₁ - B₂)
B₁ being background 1
R₁ being background 1 with image
B₂ being background 2
R₂ being background 2 with image
Can I simply use the multiply, divide, add and subtract blending modes for this?
 

SCTRWD

Power User
Messages
457
Likes
239
To steal, ups, sorry - "extract" object:) I assume the "backgrounds" you meant are just solid colors, right? (otherwise B1 = B2 at some pixel and it won't work:)).

I used following technique, commonly it gives very good results:

First - transparency:
Open both images. Look at the background colors, there RGB specs. Find the channel with the biggest difference. Let's say it's a Green channel. Now go to Image->Calculations. For Source 1 select the image with lesser Green value in background color, for Source2 select another image, For channel select Green in both sources. For Blending select Subtract. Target - New channel. Click OK. You got your channel.

Now let's refine it. Select Image->Adjustments->Curves and add two points: (0,0) and (d,255), where d - Green value difference between your background colors. Click OK. That's your mask. Load it as a selection, duplicate the source layer, press delete. Turn off source layer.

Allmost there. The only problem: we've got that ugly background color matte left in semitransparent areas. If your background color happened to be just pure black or white - you are lucky, just go to Layer->Matting ->Remove Black Matte. Or white one.

In other case you've got to make some arithmetics over chanells. I did it in Filter Factory. Just put these numbers in the dialog:

R: (r - Br)*255/a + Br
G: (g - Bg)*255/a + Bg
B: (b - Bb)*255/a + Bb
a:a
, where (Br,Bg,Bb) - background color RGB vals.

This way you can get rid of any color matte. Why on earth Adobe didn't do it?! Search me.

You can try and use Filter Factory to solve your formulas. But that would be tricky one:) Filter Factory does not work with several images - only with the current one. But you can compose all your images into one - side by side, and use various Filter Factory functions(src function) to get there values into formulas. That might work, even for image backgrounds. But check your formulas again, make sure they are right...

Or, really, try to find special software...:)
 

guyboy

New Member
Messages
3
Likes
0
Wow, this is complicated in Photoshop. Thanks for pointing out the existence of Filter Factory to me. Thing is, I just found that Wolfram Mathematica can do matrix calculations with images.
icon10.gif

This is ideal for me, but I may use Filter Factory for other things.
Also, my uses of this aren't malicious at all.
icon7.gif
 

Top