Page MenuHome

Image Editor "Erase Alpha" brush erases all channels of float images
Confirmed, NormalPublicBUG

Description

System Information
Linux 64-bit

Blender Version
Broken: 2.92
Note: In versions 2.83 and earlier, Alpha was not premultiplied (this started in rB4212b6528afb: Image Editor: Enable New Drawing, unsure if this should be the case if we are only looking at the Color without Alpha?).

Short description of error
Erasing the alpha on float images erase the RGB channels as well.

Exact steps for others to reproduce the error

  1. Open the attached file. (Left image is a Non-float while right image is Float, both have Alpha channel. We are seeing only the RGB channels).
  2. Use the brush "Erase Alpha" to erase part of the non-floating-point image (on the left).
  3. Use shift-click to sample the pixel-values of this image. The RGB channels have NOT actually been affected and the image only appears to have been premultiplied.
  4. Use the brush "Erase Alpha" on the floating-point image (on the right).
  5. Use shift-click to sample the pixel-values of this image. ALL channels were erased!

It may look like the same bug as T86866 but it isn't! The brush works as expected; it's the RGB display that's wrong.

Event Timeline

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Mar 26 2021, 4:58 PM
Germano Cavalcante (mano-wii) triaged this task as High priority.
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

Thanks for the report, I can confirm the problem.

I don't know what the industry standard is but I think the other channels shouldn't be erased when you use an "Erase Alpha" brush.
In any case, this should be consistent across different image formats.

For the number of related reports I dare to set this bug as a high priority (for now).


(Personally, I think the pre-multiplication should be optional).
(I also mentioned about this on T86764).

@Sam Brubaker (rocketman), with the edits I made, I would say that this report was even more similar to the T86866 (sorry about that).
But the idea of the pre-multiplied alpha has already been described in other reports.
So I'll merge then.

Germano Cavalcante (mano-wii) renamed this task from Image Editor appears to multiply the RGB channels by the Alpha channels when non-float images are displayed in RGB to Image Editor "Erase Alpha" brush erases all channels.Mar 26 2021, 5:22 PM

It's a funny issue because the behavior of the Erase Alpha brush appears to be ONE bug when in fact there are two different bugs. And now I don't know which bug report is which! This is exactly what I was afraid would happen, lol

I have submitted a patch to fix this problem.
However, I don't know if this is a bug or the default behavior.
For your information, this brush function seems to have been implemented in rB8f9150871c5f.

This requires a design. For images I think it should do what it says erase alpha. This means for premultiplied images it should only effect the alpha channel.
Currently it does not. There has been some discussions lately about this brush and would like the Sculpt, paint, texturing project to determine what should be done.

The image editor didn't change this behavior it only made it visible. Will remove the eevee/viewport from this issue as it isn't related to that module.

This is a result of float images always being associated alpha by convention. I think that given that convention, the erase brush affecting all channels is correct. If you make it affect just alpha it will be more consistent when looking at just the RGB channels, but less consistent when looking at the full RGBA channels.

It would be good to support unassociated alpha for float images, but I don't think we should change the behavior for associated alpha images.

If you make it affect just alpha it will be more consistent when looking at just the RGB channels, but less consistent when looking at the full RGBA channels.

I disagree; there are numerous cases where I am editing an image with associated alpha and would still like only to affect the alpha channel. What brush would I use then, besides "Erase Alpha"?

Julien Kaspar (JulienKaspar) lowered the priority of this task from High to Normal.May 12 2022, 10:25 AM

We agreed to lower the priority since this doesn't need urged fixing and has been high priority for a long time. But discussion on the issue and working towards a fix can continue.

Evan Wilson (EAW) renamed this task from Image Editor "Erase Alpha" brush erases all channels to Image Editor "Erase Alpha" brush erases all channels of float images.May 20 2022, 7:05 AM
Evan Wilson (EAW) updated the task description. (Show Details)