This is for game developers, llustrators, designers and content creators who want to create
assets with transparent background.
There are other ways to create such assets, and some are more suitable
in certain circumstances, such as when using the foliage brushes or
particle brushes, where tha Alpha channel can be enabled already, so
that the foliage can be picked up as custom brush image, fully opaque
inside the foliage, fully transparent outside in the background, and
showing a nicely anti-aliased edge at the transition. It is often
possible to clean up the light glow too along the anti-aliased edges.
That's not new. What we describe here is a new method that is similar to
the options seen in particle and foliage brushes, but now applied to
regular internal brushes and also to custom brushes. We hope this will
open up new opportunities, techniques and workflows to quickly create
graphic assets for exporting as PNG with transparent background.
This new Modal option tells the paint
engine to ignore the current alpha for upcoming brush strokes.
Normally, if there was a mask in the alpha channel, it would prevent
painting those pixels. Now with this mode, it will
not prevent painting in areas where alpha is normally blocking it.
Instead, it keeps painting your RGB colors as you paint, one brush
stroke at a time, and also adds the
alpha values to the Alpha channel for the pixels you affected with the
brush stroke, thus creating a cumulative set of
opaque (visible) pixels that you have painted. The rest remains hidden,
flagged in alpha with zero opacity, i.e. full transparency. If you use
File>Save... to save it to an image file format with
alpha, such as PNG, you get the desired effect: opaque painted image on
transparent background. You can also pick it up into he custom brush,
run some premultiply correction and other adjustments
if you need to eliminate or reduce some possible glow along the edges,
and then save from the Brush menu directly.
1. With the Brush tool selected as the current tool, select brush Settings (or hit 'o' for options)
2. Select the FX tab in the brush Settings window.
3. Select Paint on RGB and Alpha from the options menu in the Modal category
Note: Selecting this mode will clear the alpha to 0 (fully transparent).
This is different from clear Alpha (Control-D) in the Selections menu
or keyboard shortcut, where all alpha values are set to 255 (fully
visible, enabled 8-bit value). Normally, when you clear alpha, you do
want to see all pixels. In this case, however, you want the alpha
cleared so that the pixels are labeled as transparent. When you keep
painting in this mode, the alpha is being restored on-the-fly for those
pixels that receive some amount of RGB value, i.e. those that are
touched by the brush strokes.
This works both with 'Internal' brushes (such as the default Large airbrush), and custom brushes too.
It is somewhat similar to some of the Styles and modes you may have seen
in Particles brushes and Foliage brushes, where RGB + Alpha can be
enabled too, in order to help you create graphic assets that are with
transparent background when saved to PNG, Tiff, Targa in 32-bit.
Understanding the Concept: A Comparison with Particles brushes
If you recall, here's what the difference is between using the Particles brush in regular mode (without alpha, such as Lines or Shrinking Lines) and then with alpha.
Here we started with one of the presets, for Aloe.
First with Style = Shrinking Lines
Now compare with what you get whenyou switched the Style to include alpha: such as Lines + Alpha, or in this case:
Style = Shrinking Lines plus Alpha
You can then see the Marching ants of the selection mask. That's in the alpha channel.
If you also had enabled Selection> Overlay, you'll also see the
background around it with a pink coloration. The inside of the grass is
fully selected and visible at its own color. The outside is full
deselected, and shows with a pink coloration to indicate it.
Now we have the RGB colors plus the selection mask. We can save this as
an image in 32-bit depth such as the default Targa, to ensure that the
alpha mask is saved along with the RGB color channels. We can also pick
this up into the custom brush. For example with the Custom brush
selector, or from the top of the Brush menu: Use selected as brush.
Once you store this custom brush (Brush > Store and manage...), you will see the solid grass vs. the transparent background.
This brush can be used now in painting all over the landscape.
Doing the Same with Regular Brushes: Internal and Custom Brushes
So, the idea is to enable the same technique for regular brushes. This
should allow us to create assets. In this concept, an asset is a painted
piece that stands solid against a transparent background.
Perhaps the best way to get started is to use a brush without anti-aliasing along its edges. Use one of the Simple brushes.
For example, use the Medium Simple brush. You can find it in several places, such as right-clicking the brush tool, or with the small pulldown arrow next to the media browser, and in the media browser itself too.
Draw a few brush strokes first in the normal mode which only will draw
into the RGB channels. Change color a few times between brush strokes:
Now, let's also remind ourselves of what usually happens if there was an
alpha selection mask present already. The mask acts as an enabler or
blocker. It allows painting the RGB values into the selected regions,
i.e. those pixels which lie "within" the marching ants region. It
disables and prevents painting outside of it. Here is a single brush
string in Tempera paint, red tone, zig-zag across a selection mask that
reads 'MASK ME'....
That's the normal, usual way to use the alpha channel: as a selection mask.
Now, let's start over: Switch to the FX tab in the brush settings window, and enable Modal mode for RGB + Alpha.
After you draw the first brush stroke:
And then change color and draw another, second stroke.
And yet another stroke at another color.
You will see the marching ants, and the pink tinting of the background if enabled in the Selection menu.
You can now pick this up as usual as a custom brush and paint with it.
So, this is a new way to create graphic assets. You might enjoy it. You might find it suitable for your needs. Give it a try.
The above example was with a Simple brush, which has no anti-aliasing
along the edges of the brush image. Its pixels are either full opaque or
fully transparent. But what if you have something like the default
airbrush? Or many other forms of brushes, with britles and a variety of
opacities in them? Won't there be some glow along the edges, if the
background was white?
There are limits to what can be done here, but it still is useful in
many cases. Yes in some cases the glow is too wide to be addressed with
pre-multiply alpha. But for some brushes it will be good. And in other
cases, you may know already what color the background is. So don't use
plain white. Use that background. Even an image, if it matches or comes
close to what you'll use.
For example if you draw a text logo and plan to use it over a red sunset
view, don't use blue, white or green or something totally different.
Use a similar red. Or even the same image.
This tool is still new and we're exploring ways to make it better.
Here is an in-depth tutorial:
Paint on RGBA - adding selection to alpha with each brush stroke