Soft Light and Linear Blend modes for compositor. Also, fixed Darken Mode
Closed, ArchivedPublic

Description

This patch implements the algorithm for SoftLight blending a la the extremely popular and useful Photoshop (gasp) blending mode. I use it all the time in PS, and was going for a particular effect and found it impossible to reproduce in the compositor. The math was simple, so I put it in.

This is a very useful blending mode for those into image-fu.

Example of usefulness here:
http://www.sitepoint.com/blogs/2004/09/01/photoshops-soft-light/
It's also very good at adding a color cast while letting the original hues through in an interesting way.

This was tested side by side with the PS result and they appear to be identical. Which isn't really surprising as numbers are numbers, I guess.

Personally, I don't care if this patch ever goes to trunk, but I NEEDED it for an excellent film-look effect node network and thought I'd share.

Details

Type
Patch

Add Linear Light blend mode, which, when applied at 0.5 mix factor to an inverted blurred image produces the High Pass filter that is useful for sooooo many things. Both Linear Light mode and the resulting High Pass result appear to be pixel-for-pixel identical to the Photoshop result for the same piece. Attached is a .png with the PS result on the right and the compositor result on the left.

Also, fixed Darken blend mode. It was functioning incorrectly, as when you would lower the blend factor, the mixing color was simply multiplied with it, sending it to black, which results in you output from the Darken node reaching all black (0,0,0) by the time the mix factor was at 0. It should have been tending the mix in value toward 1, not 0, as factor decreased. It now functions properly.

Man... put this in 2.47! PLEASE...
I know, 2.47 is almost out... but "its just" a color mode.

Thanks for the great addiction Roland! :)

Looks good, some remarks:

- I tried to make it a good habit to do all blend mode menus and code, so options are uniform available everywhere
- the fix for darken... should ask around how much this breaks old composites?

New patch, implementing the blend modes across node materials, ramps, textures, etc. so is uniform throughout. Called "new_blend_modes.txt". I have to try this patch out on a clean checkout, though... haven't done so yet.

Not sure how to check around about people using the obviously incorrect implementation of Darken mode, but I'll give it a shot.

Approved and applied as a patch for 2.5.

Roland Hess (harkyman) closed this task as Archived.Nov 25 2009, 7:15 PM