The alpha channel is an extra data component of a pixel (in addition to RGB.) Instead
of color information it contains this pixel's degree of transparency between 0 (fully transparent)
to 255 (fully opaque). Portable Network Graphics format (PNG) is currently the only major image format
that supports alpha channel. This unique feature enables a PNG picture to blend perfectly with any image or background
it is placed on, without unsightly artifacts around the edges.
Starting with version 1.7, AspJpeg offers the DrawPNG method which allows
you to draw PNG images with an alpha channel. This method expects three arguments, the X and Y offsets
of the picture being drawn relative to the larger image, and the path to the PNG file:
jpeg.Canvas.DrawPNG 10, 10, "c:\path\logo.png"
The latest version of AspJpeg can be downloaded from www.aspjpeg.com.
The following picture is a PNG image with an alpha channel you may use for your experiments:
To create an alpha-channel enabled PNG image in Photoshop, follow these simple steps:
- Open your artwork in Photoshop, or create a new one, if necessary.
- Use Blending Options to create a drop shadow for your picture.
- In the Layers panel, unselect the "eye" icon of the Background layer to give your artwork
a transparent background.
- Select File/Save for Web.
- In the Save for Web window under Settings, select "PNG-24" and check the Transparency checkbox.
- Click OK to save the image to disk.