Page MenuHome

Incorrect RGB display in Image Viewer when not viewing alpha channel
Closed, ResolvedPublicBUG


Version: 2.82a (Linux 64)

How to reproduce:

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

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:

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!

Event Timeline

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

Thankyou, @Germano Cavalcante (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.

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

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Mar 24 2020, 1:50 PM
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

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

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:

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.

@Jacques Lucke (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:

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.

Jeroen Bakker (jbakker) closed this task as Resolved.Sep 11 2020, 11:54 AM
Jeroen Bakker (jbakker) claimed this task.

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