Page MenuHome

Paint Mode: Eraser Tool
Needs Triage, NormalPublicDESIGN

Description

Goal

For an intuitive painting workflow it's necessary to have an eraser at your finger tips at all times.
This has been a shortcoming in Blender for painting, since the erasing of alpha channels has only been available as a blending mode for brushes.
This is very hard to access via the UI and shortcuts.

Proposal

The ideal solution is to have a very simple brush tool in the toolbar. Aside from the typical texture, stroke, fallof and cursor settings, it can only erase alpha.

This tool can then have the shortcut E assigned by default.

Pure Emissive Colors

The motivation behind not offering a blending mode to "Add Alpha" in the Erase Tool is because this has been notoriously difficult to do like the user would expect.
See T86868 & T83342.

When painting float or premultiplied images, the alpha is treated differently. Aany color with an alpha 0 would ahve the RGB colors displayed as pure emmissive colors and still visible.
The only way to erase the colors completely is to also erase the RGB channels to 0.

As a result the design for the brush should emphasise this: The Erase brush is a destructive tool!
If you erase the alpha directly via painting tools you should expect to likely lose the full RGBA color information.
The alpha 0 areas can be painted over with a new color afterwards.

For non destructive erasing of alpha values it is recommended to use a separate image as a mask. This can be done right now via nodes.
This non-destructive approach might not be very accessible right now but that can be addressed separately (Especially with the layered textures design)

Other Tools

There are and will be various other tools that will affect color. It will be beneficial to have the opportunity to erase colors with them as well.

  • Gesture Tools - Box/Lasso/Line Erase
  • Color Filter - Erase Filter Type

Erase Mode

An alternative approach that would be good to make possible is to make the "Erase Alpha" blending mode in the regular painting tools more accessible.
In other painting application such as Krita every tools and brush has an "Erase Mode" button that can be easily toggled with a shortcut and applies globally to all tools and brushes.
We could implement this design as an alternative to the Erase Tools for users that prefer this workflow.

In that case the Erase Alpha blending mode would be a button in the header that can be toggled and have a shortcut assigned, instead of being part of the blending modes popup.
This toggle should be available for for all brushes and tools that affect colors.
This could be easily accessible with the shortcut Alt E so both workflows of erasing are supported by default.

Event Timeline

From the recent module meeting:

But we need to be aware of use cases to still add/remove alpha. For gamedev the alpha channel is often used for other purposes than transparency.

One possible fix: We can prevent destructive erasing by changing the behaviour directly in the color mixing of brushes & tools. This would prevent erasing the RGB values on color attributes and most image types (Including newly created images that aren’t saved yet).
When erasing on pre-multiplied images on the other hand, we could still allow erasing alpha channel in an expected way within Blender. Afterwards when saving the file it would cause data loss that should’ve happened already while erasing.
Here we must show a warning message to the user, which gives them the chance to save to another image format or ways to export before saving.

We'll discuss further how well we can preserve the Alpha channel while erasing.