 |
Paint Shop Pro (PSP) is a
trademark of JASC (Jets and Software Corp.), which was acquired by
Corel Corp a while back. PSP is a popular and powerful image editing
software. It comes loaded with numerous features and has gained an
impressive level of popularity.
In this tutorial we'll explore some techniques to use PD Particles with
PSP. We're using PSP 7 but much of what's shown here should work with
later (and earlier) versions.
So, here we are, in PD Particles, having painted a tuft of long grass.
We chose the Style called 'Line+Alpha', which has not only rendered the
color image of the grass but also a selection mask (alpha channel),
shown by the familiar 'marching ants' outlines. This should allow us to
use such grass in a layer with the rest around it staying transparent
|
 |
At this point you could
simply save the image in one of the formats that will save the rgb
channels along with the alpha channel (selection mask) in a single
file, such as Tiff, Bmp, Png or Targa. These files can be opened in PSP.
However, we may have just realized that perhaps the image is not ready
after all. The background being white, there are anti-aliased pixels
along the grass which blend some whiteness into themselves. If we are
to composite this image in a layer in front of a dark image, the white
edges might show as an unsightly.
It might be better to re-do the painting and use a dark background.
|
 |
But what to do if it took
minutes or hours to paint the perfect weed?
Here's a trick to turn the image into one with black background.
First we'll invert the pixels inside the selection. Then we'll
temporarily disable the alpha selection, re-invert the whole image,
causing the parts that are solid grass and were in the selection to
revert back to their original color, while the outside white pixels
turn black. In the end we turn the alpha selection mask back on.
Make sure tha alpha channel is still showing. Then start by using the
menu:
Filter > Color > Negative
The yellow-green grass turns blueish. The white background is
unaffected by the inversion as it is protected through the
selection mask.
|
 |
Now that the grass is
inverted, temporarily disable the selection mask. Use the menu:
Alpha > Alpha on/off
There is a backslash keyboard shortcut available for this toggle.
This doesn't clear the alpha mask away for good. It only temporarily
disables it, so that the next filter effect can affect the entire
image, not just the selected pixels of the grass.
|
 |
Now use the same filter
again to re-invert everything. The white background turns black, the
blueish grass reverts back to its original colors.
This may not be perfect, but it will have to do. We're pretending after
all that we spent hours in painting something and try to fix the
background color.
|
 |
We can now turn the alpha
channel back on.
We now have an almost identical foliage system with black background.
It
is only almost and not exactly the same grass because along the
anti-aliased edges of the grass, we inverted the pixels only in
part when the alpha channel was still present at first, but then we
completely inverted them the second time when the alpha channel was
turned off. Thus, these pixels along the edges did undergo a series of
filter effects that did not restore the original pixel values, but
that's ok since we really don't want the pixels to gain a white glow
there. Black is beautiful :-)
Another technique by-the-way could have been this:
1) invert the Alpha selection mask
2) clear the current selection to black
3) reverts the selection mask to the original
This causes the white background to be erased to black, and the
anti-aliased pixels along the edges of the grass to also be erased but
only to a lesser degree based on the alpha values. The closer to the
inner parts of the foliage, the lesser the impact of the clear
function. Pixels which are closer to the background are more affected
while the alpha is inverted. This is the effect we want, with the edges
of the grass fading to the darkness of the now black background.
|
 |
But in the end, of course,
we might remember next time to actually start with a black background.
Clear the alpha channel if one is present - use Control-D or select the
Clear Alpha option from the Alpha menu,
Then right-click on the Clear tool, which is the big 'X' icon in the
right side of the Drawing tools.
Then draw your grass, and get ready to save it.
|
 |
When you save the image to
file, make sure you select one of the formats that are able to save the
alpha channel. The Default Targa (*.tga) format is recommended, but
others may also work for you. In fact, you may want to try Tiff, Bmp,
Png and the second Targa formats, and see which of these will
work the best for your version of PSP. Some formats work better
than others. For example, in some formats, PSP 7 may automatically
assign the alpha channel as a transparency mask, whereas in other cases
you may need to extract the selection from the alpha channel and then
copy/paste into a new layer.
The behaviour of these different formats may also vary with the
versions of PSP which you use, so it is a good idea to experiment a
little before you settle for one format.
Tiff, Png and Bmp formats are popular and handy because Windows
Explorer can also view their Thumbnails. Targa can also be seen as
thumbnails with the help of a free extension for Windows Explorer. (Thumb Plug TGA)
|
 |
The Tiff, Png and Bmp
formats as well as the 'Targa' format won't ask for more details.
They'll save the image along with the alpha channel if there is one
found present.
The 'Default Targa' format on the other hand presents and
additional dialog window for you to choose the desired pixel depth:
8 bits as color or greyscale
24-bit RGB color
or
32-bit for RGB and Alpha
Select the 32-bit scenario and click 'Save'.
|
 |
Sometimes you will prefer
to have two searate files: one for the color (24-bit RGB) and a second
file for the alpha channel's selection mask as a greyscale image. It
might even be a 24-bit RGB image containing the greyscale image. Either
way, the alpha can be saved in its own image file.
Some 3D programs will require two separate files. Others have the
ability to extract and use the alpha channel from a 32-bit per pixel
file format. And other programs support either case.
But how to turn the Alpha mask into a greyscale image and save it?
Well, simply clear the selected to white. If the selection is the
inside of the grass, it will loose its green/yellow colors. The parts
which are totally opaque inside the grass will be fully white. The
parts in the edges of the grass will be turned greyish. Perhaps not
completely, but we can also use a greyscale filter. Or, when we save
the image and select the 8-bit greyscale format it will do that
conversion automatically.
|
 |
After saving an image, you
might want to verify in some other image viewer if it does have the
proper image pixel depth. For example, one of the most popular free
image viewers, Irfanview (www.irfanview.com)
can report the original depth found on while. Here it shows a 32-bit
format. The image being displayed is only 24-bit, as it tosses the
alpha channel to only show the colors.
If the image file is uncompressed, you can also expect to see the file
size and the in-memory size different by about 25%.
|
 |
By way of comparison,
here's an example of an image that is 24bit per pixels, such as
uncompressed Tiff or Targa saved without the alpha.
|
 |
How about PSP7 ?
Similar thing. You can find the Image Information option in the Image
menu.
|
 |
Don't necessarily trust
everything you see though. In this example, the information shows 0
(zero) for the number of alphas, when in fact it does have an alpha
channel.
|
 |
Here's one way to check if
the loaded image file actually did contain an alpha channel that PSP
will let you use.
After opening the image from file, select the menu:
Seections > Load From Alpha Channel...
If the alpha channel was detected by the image loader of PSP, this will
let you use it.
|
 |
In this case, indeed, an
Alpha channel 1 was found and available for defining a selection mask.
Simply click 'OK' to continue and create a selection mask from the
alpha channel.
If you try this with a Jpeg image, or any format that wasn't saved with
an alpha channel, you will see this fail with a warning message
to the effect that there was no alpha channel found.
|
 |
PSP now has reconstructed
the selection mask from the alpha channel.
We're still using just one layer, the Background layer.
|
 |
With that selection mask
in
effect now, we can simply copy all pixels which it contains.
Use the Edit menu or Control-C to Copy the selection.
|
 |
Next, Paste the selection
back, into a new layer.
Control-L s a handy keyboard shortcut for this, and easy to remember: L
for layer.
|
 |
There it is, Layer 1 above
the Background layer was just added. Move and rest the cursor over the
layer and you'll see a thumbnail popup, showing the familiar
checkerboard for the transparent parts.
|
 |
To see that new layer's
image by itself, click the 'glasses' of the Background layer to hide it.
|
 |
Clear the selection mask
to get a clearer view of the grass. A commonly found keyboard shortcut
for this is Control-D
|
 |
Using Windows Explorer for
viewing images in Thumbnails mode, notice that some are shown with
black background, others with white background. It seems like Windows
is interpreting the alpha channel as transparency in thumbnails for
some of these formats too, namely for Png and Tiff.
|
 |
Our version 7 of PSP does
the same. For example, opening the Png file, it automatically made the
background layer carry the image with transparency around the grass.
Lesson learned: depending on which format you use, you may get
immediate and instant gratification. Or you'll need a few more click to
get to the desired result.
|
 |
Here's the Targa format.
It too carries an alpha channel, and we can use it to build a selection
like in the Bmp case earlier on.
|
 |
The Tiff image case
behaves the same. And the Information on the loaded image shows the
presence of one alpha channel.
|
Here are sample image files created with PD Particles and saved in
several formats, so you can try the same and compare with your version
of PSP.
|

|

|