Setting alpha channel in compositor affects RGB channels (white artifacts) #72740

Closed
opened 2019-12-28 00:27:12 +01:00 by Daniel · 13 comments

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 432.00

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: f1aa4d18d4
Worked: probably never

Short description of error
When combining RGB channels with alpha channels in the compositor, this generates white artifacts on the output RGB channels.

Exact steps for others to reproduce the error
Use some RGB image and either use the set alpha, separate rgba and combine rgba setup (as shown in the image) and connect this to the composite, viewer or some file output node for the viewer or compositor output one can also use the dedicated alpha output, all methods result in white artifacts on the RGB channels, this causes problems when one wants to use the compositor for channel packing involving the alpha channel (combining four greyscale maps into a single RGBA image).
image.png
alpha_fail_on_rgb.blend
(toggle the backdrop option in the compositor to trigger the processing)
Another example that uses actual render layers:
rendered_alpha_artifacts.blend

**System Information** Operating system: Windows-10-10.0.18362 64 Bits Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 432.00 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: `f1aa4d18d4` Worked: probably never **Short description of error** When combining RGB channels with alpha channels in the compositor, this generates white artifacts on the output RGB channels. **Exact steps for others to reproduce the error** Use some RGB image and either use the set alpha, separate rgba and combine rgba setup (as shown in the image) and connect this to the composite, viewer or some file output node for the viewer or compositor output one can also use the dedicated alpha output, all methods result in white artifacts on the RGB channels, this causes problems when one wants to use the compositor for channel packing involving the alpha channel (combining four greyscale maps into a single RGBA image). ![image.png](https://archive.blender.org/developer/F8247003/image.png) [alpha_fail_on_rgb.blend](https://archive.blender.org/developer/F8248223/alpha_fail_on_rgb.blend) (toggle the backdrop option in the compositor to trigger the processing) Another example that uses actual render layers: [rendered_alpha_artifacts.blend](https://archive.blender.org/developer/F8248239/rendered_alpha_artifacts.blend)
Author

Added subscriber: @bestdani

Added subscriber: @bestdani
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

I assume the issue here is that you use an alpha mode for the image that is not correct for your use case. I cannot check that because you did not upload the .blend file. Please always provide a simple test file with the images packed into it for reports like this.

The white border are usually related to premultiplied alpha afaik.

I assume the issue here is that you use an alpha mode for the image that is not correct for your use case. I cannot check that because you did not upload the .blend file. Please always provide a simple test file with the images packed into it for reports like this. The white border are usually related to premultiplied alpha afaik.
Author

I have just added a blend file with even some little bit simpler (and cc0) images.

It also reminds me of premultiplied alpha, but in this case it happens on the output images and there's no option to change the alpha behavior at all for this afaik.

I'm also not sure if this is intended or not, so if this is an actual bug or not. At least I was not expecting that setting an alpha channel like that would affect the RGB channels of an image and I guess in many use cases where one wants to pack for example roughness together with a rendered / baked albedo or normal into a single RGBA image this is probably not what is wanted and expected to happen.

I have just added a blend file with even some little bit simpler (and cc0) images. It also reminds me of premultiplied alpha, but in this case it happens on the output images and there's no option to change the alpha behavior at all for this afaik. I'm also not sure if this is intended or not, so if this is an actual bug or not. At least I was not expecting that setting an alpha channel like that would affect the RGB channels of an image and I guess in many use cases where one wants to pack for example roughness together with a rendered / baked albedo or normal into a single RGBA image this is probably not what is wanted and expected to happen.
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

Unfortunately, I also don't know that. @Jeroen-Bakker might be able to answer that color management question for the compositor.

Unfortunately, I also don't know that. @Jeroen-Bakker might be able to answer that color management question for the compositor.

Added subscriber: @iss

Added subscriber: @iss

looks like quite different issue, but similar in result #69106 (White outline around alpha in texture paint (when using multiple layers))

looks like quite different issue, but similar in result #69106 (White outline around alpha in texture paint (when using multiple layers))

Added subscriber: @brecht

Added subscriber: @brecht

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

Changed status from 'Needs Triage' to: 'Archived'
Brecht Van Lommel self-assigned this 2020-01-18 18:30:23 +01:00

The Blender compositor uses premultiplied / associated alpha. That means if you want to apply an alpha mask to an image, that must affect not only A, but also be multiplied into the R, G, B channels.

Rather than manually manipulating the channels like this, it's easier to use for example an Alpha Over node to to mix between a given image and a fully transparent RGBA color.

The Blender compositor uses premultiplied / associated alpha. That means if you want to apply an alpha mask to an image, that must affect not only A, but also be multiplied into the R, G, B channels. Rather than manually manipulating the channels like this, it's easier to use for example an Alpha Over node to to mix between a given image and a fully transparent RGBA color.
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
4 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#72740
No description provided.