Soft Light and Linear Blend modes for compositor. Also, fixed Darken Mode #17504

Closed
opened 2008-08-21 17:56:17 +02:00 by Roland Hess · 7 comments

%%%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.%%%

%%%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.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%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.%%%

%%%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! :)%%%

%%%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! :)%%%
Member

%%%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?%%%
%%%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?%%%
Author

%%%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.%%%

%%%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.%%%
Author

%%%Approved and applied as a patch for 2.5.%%%

%%%Approved and applied as a patch for 2.5.%%%
Author

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#17504
No description provided.