Incorrect RGB display in Image Viewer when not viewing alpha channel #74709

Closed
opened 2020-03-13 05:08:32 +01:00 by Sam Brubaker · 14 comments

Version: 2.82a (Linux 64)
RGB_bug.blend
How to reproduce:

  • Open the attached file and render the frame.
  • In the display_channels menu in the header of the Image Viewer, select "Color" (Not "Color and Alpha")
  • Mouse over the pixels of the image and Compare the RGB values with the displayed values.
  • Display the individual RGB color channels as well

RGB_bug.png

The above image looks as though the rim of the shape is solid grey, but in fact the explicit RGB values do fade from grey to black, due to the blur node.

When viewing an image in Color without alpha, or in Red, Green, or Blue Display mode, the image viewer seems to "pre-divide", or perhaps "un-premultiply" the RGB values, which causes incorrect values to display. This makes it very difficult for the user to work with alpha channels!

Adding an Alpha Convert node makes matters even worse:
RGB_bug1.png

Now, the explicit RGB values really are a solid grey, but in the image view the rim is displayed as getting brighter! Not a good workflow at all!

Version: 2.82a (Linux 64) [RGB_bug.blend](https://archive.blender.org/developer/F8403084/RGB_bug.blend) How to reproduce: - Open the attached file and render the frame. - In the display_channels menu in the header of the Image Viewer, select "Color" (Not "Color and Alpha") - Mouse over the pixels of the image and Compare the RGB values with the displayed values. - Display the individual RGB color channels as well ![RGB_bug.png](https://archive.blender.org/developer/F8403070/RGB_bug.png) The above image looks as though the rim of the shape is solid grey, but in fact the explicit RGB values do fade from grey to black, due to the blur node. When viewing an image in Color without alpha, or in Red, Green, or Blue Display mode, the image viewer seems to "pre-divide", or perhaps "un-premultiply" the RGB values, which causes incorrect values to display. This makes it very difficult for the user to work with alpha channels! Adding an Alpha Convert node makes matters even worse: ![RGB_bug1.png](https://archive.blender.org/developer/F8403079/RGB_bug1.png) Now, the explicit RGB values really are a solid grey, but in the image view the rim is displayed as getting brighter! Not a good workflow at all!
Author

Added subscriber: @rocketman

Added subscriber: @rocketman

Added subscriber: @mano-wii

Added subscriber: @mano-wii

The color that is read in the ibuf comes with alpha premultiplied.
I don't quite understand why it happens, but I imagine it is important for the final image.

(This is an area that I'm not familiar with).

The color that is read in the `ibuf` comes with alpha premultiplied. I don't quite understand why it happens, but I imagine it is important for the final image. (This is an area that I'm not familiar with).
Author

Thankyou, @mano-wii . It doesn't seem to affect the final image. If, for instance, you save the image to a file, the saved image will have the correct colors (the values explicitly stated when you mouse over the pixels), whether or not you enable alpha. It will not look like the result displayed in the viewer. The viewer is showing RGB values which don't seem to relate with how the final image looks.

Thankyou, @mano-wii . It doesn't seem to affect the final image. If, for instance, you save the image to a file, the saved image will have the correct colors (the values explicitly stated when you mouse over the pixels), whether or not you enable alpha. It will not look like the result displayed in the viewer. The viewer is showing RGB values which don't seem to relate with how the final image looks.
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

#74586 Switching between passes in the image editor can make the channel selector invalid.

#74586 Switching between passes in the image editor can make the channel selector invalid.

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

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

It deserves an investigation.
I'm confirming as a bug.

It deserves an investigation. I'm confirming as a bug.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

If you want to do a compositing operation with straight alpha, the Alpha Convert node can be used. Typically this would be a color correction operation where it might give better results working on RGB channels without alpha. If the alpha is converted to straight in the Compositor, it should be converted back to premultiplied before the Composite Output node, otherwise some artifacts might occur.

This is from the manual page: https://docs.blender.org/manual/en/latest/compositing/types/converter/alpha_convert.html

While I'm not entirely sure, I don't think there is a real bug here... Some time ago I heard that this is more a general design issue of how alpha is handled in the compositor.

> If you want to do a compositing operation with straight alpha, the Alpha Convert node can be used. Typically this would be a color correction operation where it might give better results working on RGB channels without alpha. If the alpha is converted to straight in the Compositor, it should be converted back to premultiplied before the Composite Output node, otherwise some artifacts might occur. This is from the manual page: https://docs.blender.org/manual/en/latest/compositing/types/converter/alpha_convert.html While I'm not entirely sure, I don't think there is a real bug here... Some time ago I heard that this is more a general design issue of how alpha is handled in the compositor.
Author

@JacquesLucke As far as I'm aware, the compositor handles alpha perfectly fine. This is an issue specifically with how the Blender image viewer presents an image buffer when only the RGB channels are displayed. Here is a very simple example:

screen.png

Here I have taken a simple color grid image, reduced the alpha, and displayed the result in the backdrop, showing only the RGB and not Alpha. The "Set Alpha" node does not (nor should it) have any effect on the RGB values. Thus, when viewing only the RGB channels, I would expect the displayed image to be unchanged (and when I save the image as RGB, it is). And yet, reducing the Alpha causes it to be shown brighter in Blender! Again, I must stress that this result does not appear in the saved image, and no other image viewer to my knowledge displays images like this.

It is as if a "Premul to Straight" operation has been performed prior to displaying the RGB image buffer in Blender. This is not, under any circumstances, useful to me as a user! When I want to see the RGB buffer without alpha, that means I want to see the RGB buffer without alpha, not what the RGB buffer would look like if I did a premul-to-straight conversion beforehand.

@JacquesLucke As far as I'm aware, the compositor handles alpha perfectly fine. This is an issue specifically with how the Blender image viewer presents an image buffer when only the RGB channels are displayed. Here is a very simple example: ![screen.png](https://archive.blender.org/developer/F8558683/screen.png) Here I have taken a simple color grid image, reduced the alpha, and displayed the result in the backdrop, showing only the RGB and not Alpha. The "Set Alpha" node does not (nor should it) have any effect on the RGB values. Thus, when viewing only the RGB channels, I would expect the displayed image to be unchanged (and when I save the image as RGB, it is). And yet, reducing the Alpha causes it to be shown brighter in Blender! Again, I must stress that this result does not appear in the saved image, and no other image viewer to my knowledge displays images like this. It is as if a "Premul to Straight" operation has been performed prior to displaying the RGB image buffer in Blender. This is not, under any circumstances, useful to me as a user! When I want to see the RGB buffer without alpha, that means I want to see the RGB buffer without alpha, not what the RGB buffer would look like if I did a premul-to-straight conversion beforehand.
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jeroen Bakker self-assigned this 2020-09-11 11:54:49 +02:00
Member

This issue has been resolved by D8234. Please report any new issues as new reports

This issue has been resolved by [D8234](https://archive.blender.org/developer/D8234). Please report any new issues as new reports
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
5 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#74709
No description provided.