video editing / Compositing multiply mode #78727

Closed
opened 2020-07-08 07:52:06 +02:00 by Ahryeom HAN · 18 comments

System Information
Operating system: Fedora 30
Graphics card: nvidia

Blender Version
Broken: 2.83.1
Worked: NA

Short description of error
Multiply mode doesn't work as expected.

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

1/
On VSE, add image
[ background-shadow.png ] background-shadow.png
[ background.png ] background.png

2/
change mode to multiply of background-shadow.png
background.png mode : Cross

result screen shot: Screenshot from 2020-07-08 08-12-23.png

What I expected : ex.png

**System Information** Operating system: Fedora 30 Graphics card: nvidia **Blender Version** Broken: 2.83.1 Worked: NA **Short description of error** Multiply mode doesn't work as expected. **Exact steps for others to reproduce the error** Based on the default startup or an attached .blend file (as simple as possible). 1/ On VSE, add image [ background-shadow.png ] ![background-shadow.png](https://archive.blender.org/developer/F8677616/background-shadow.png) [ background.png ] ![background.png](https://archive.blender.org/developer/F8677617/background.png) 2/ change mode to multiply of background-shadow.png background.png mode : Cross result screen shot: ![Screenshot from 2020-07-08 08-12-23.png](https://archive.blender.org/developer/F8677619/Screenshot_from_2020-07-08_08-12-23.png) What I expected : ![ex.png](https://archive.blender.org/developer/F8677624/ex.png)
Author

Added subscriber: @Aryeom

Added subscriber: @Aryeom
Author

Sorry I didn't finish the report.
I entered by mistake. I am filling the fields now.

Sorry I didn't finish the report. I entered by mistake. I am filling the fields now.
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

Blender has a bad support for single channel png images. it loads all values with that value including the alpha.
A work around is to change the mask image to be an RGB image.

Blender has a bad support for single channel png images. it loads all values with that value including the alpha. A work around is to change the mask image to be an RGB image.
Author

Ok. I tried to export as jpg, and it works. Thanks for the tip! :)
Though I hope it will be fixed soon. It makes workflow cumbersome.

Ok. I tried to export as jpg, and it works. Thanks for the tip! :) Though I hope it will be fixed soon. It makes workflow cumbersome.

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Not sure If I could consider this as duplicate of #75844, as I have been following GIMP blend mode reference, so not sure if I have touched multiply.

Will leave this as just a reference for now

Not sure If I could consider this as duplicate of #75844, as I have been following GIMP blend mode reference, so not sure if I have touched multiply. Will leave this as just a reference for now

Added subscriber: @jehan

Added subscriber: @jehan

Added subscriber: @brecht

Added subscriber: @brecht

Single channel PNG are loaded correctly as far as I can tell, and the attached images are not single channel anyway. I think this is just poor behavior of blend modes in the sequencer with alpha.

Single channel PNG are loaded correctly as far as I can tell, and the attached images are not single channel anyway. I think this is just poor behavior of blend modes in the sequencer with alpha.

Used images are not single-channel indeed. They were simple RGBA. What Aryeom did as a workaround was to make the top image (the one in multiply mode) into a RGB image, replacing transparent data by 1, 1, 1 (white) as it seemed that Jeroen was implying that the problem was when using an alpha channel (though it's true that he was also writing about single-channel images and "mask image"; it's not really a mask in the usual sense, just a normal color layer).

And indeed removing the alpha channel worked around the bug.

Really for very common compositing modes, such as multiply, I think that all graphics software are just following the W3C "SVG Compositing Specification": https://www.w3.org/TR/SVGCompositing/#comp-op-property

This is also what Bender should do. :-)

Used images are not single-channel indeed. They were simple RGBA. What Aryeom did as a workaround was to make the top image (the one in multiply mode) into a RGB image, replacing transparent data by 1, 1, 1 (white) as it seemed that Jeroen was implying that the problem was when using an alpha channel (though it's true that he was also writing about single-channel images and "mask image"; it's not really a mask in the usual sense, just a normal color layer). And indeed removing the alpha channel worked around the bug. Really for very common compositing modes, such as multiply, I think that all graphics software are just following the W3C "SVG Compositing Specification": https://www.w3.org/TR/SVGCompositing/#comp-op-property This is also what Bender should do. :-)

Thanks for nice resource with code examples :)

Thanks for nice resource with code examples :)

No prob. If you don't have all the information, maybe you'll want to read this too: https://www.w3.org/TR/compositing-1/

There is actually a lot more to good compositing than just one operation. If you look at GIMP nowadays, we can set the compositing and the blending modes ("multiply" is actually a blend operation, unlike the very inaccurate "compositing" term I used the previous comment; my bad), which are 2 separate steps to compositing 2 images into one.

Then you have the question on whether you should be working on a linear or gamma-corrected workflow. If you look at GIMP, we now provide 2 "multiply" blending modes. The "Legacy" one is gamma-corrected and the new multiply is linear. Or to be more accurate, you can actually choose the blend space (linear or perceptual) with our new "multiply" blend mode (right click a layer, "Blend Space" item in the contextual menu), and we default to "Linear". This is quite important to abstract your computation from the output (or input) curve.

This is also something Blender should be looking into in order to be compatible with GIMP rendering and to have better blending conformance.

If you follow this spec, you should be fine. I'm happy to help (as much as I can, as I'm not myself the biggest expert on colors in GIMP, so I hope I am not saying too much mistake myself! Ahah! 🤣) because Aryeom and I work with both GIMP and Blender and we'd really like for the rendering to stay consistent, at least for the standardized blend modes.

No prob. If you don't have all the information, maybe you'll want to read this too: https://www.w3.org/TR/compositing-1/ There is actually a lot more to good compositing than just one operation. If you look at GIMP nowadays, we can set the compositing and the blending modes ("multiply" is actually a blend operation, unlike the very inaccurate "compositing" term I used the previous comment; my bad), which are 2 separate steps to compositing 2 images into one. Then you have the question on whether you should be working on a linear or gamma-corrected workflow. If you look at GIMP, we now provide 2 "multiply" blending modes. The "Legacy" one is gamma-corrected and the new multiply is linear. Or to be more accurate, you can actually choose the blend space (linear or perceptual) with our new "multiply" blend mode (right click a layer, "Blend Space" item in the contextual menu), and we default to "Linear". This is quite important to abstract your computation from the output (or input) curve. This is also something Blender should be looking into in order to be compatible with GIMP rendering and to have better blending conformance. If you follow this spec, you should be fine. I'm happy to help (as much as I can, as I'm not myself the biggest expert on colors in GIMP, so I hope I am not saying too much mistake myself! Ahah! 🤣) because Aryeom and I work with both GIMP and Blender and we'd really like for the rendering to stay consistent, at least for the standardized blend modes.

Added subscriber: @Sergey

Added subscriber: @Sergey

@iss, i think it's better to have single task to track all inconsistencies of blending mode.

@iss, i think it's better to have single task to track all inconsistencies of blending mode.

Ok, I will merge this report then

Ok, I will merge this report then

Closed as duplicate of #75844

Closed as duplicate of #75844
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
6 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#78727
No description provided.