This script allows you to use images (PNG) or JPG) with alpha channels. the alpha channel can be delivered as a separate 8-bit PNG ("mask") or, for PNG, as well as internal alpha channel. For the latter, an extension of GD 2.x is required.
Defining a separate mask image has several advantages: - GD is not required. - Better quality (full 8-bit alpha channel, while GD only supports 7-bit alpha channels internally) - much faster (you need to extract the embedded alpha channel pixel-wise)
Image function (string file, float x, float y [, float w [, float h [, string type [, mixed link [, boolean isMask [, int maskImg]]]]]])
The same parameters as for the original Image () - a method, with 2 additional (optional): isMask: if specified and true, the image is used as a mask for other images. In this case, the parameters x, y, w and h will be ignored, and the mask image itself will not be displayed on the page. maskImg: the amount of image resources (as returned by the previously named Image () with the isMask parameter set to true) that will be used as the mask for this image.
ImagePngWithAlpha function (line file, float x, float y [, float w [, float h [, mixed reference]]])
The same parameters as for the original Image () - a method, but without the type Parameter.