PHP imagecolorallocatealpha - Allocate a Color and Transparency for an Image
imagecolorallocatealpha — Allocates a color and transparency for an image.
Syntax
int imagecolorallocatealpha ( resource $image , int $red , int $green , int $blue , int $alpha )
imagecolorallocatealpha() behaves the same as imagecolorallocate(), but with an additional transparency parameter alpha, whose value ranges from 0 to 127. 0 means fully opaque, 127 means fully transparent.
Returns FALSE if allocation fails.
**Note:** This function requires GD 2.0.1 or higher (2.0.28 or higher recommended).
Example
The image of the output result of the example above is as follows:
Related Articles
- imagecolorallocate() Allocate a color for an image.
- imagecolordeallocate() Deallocate the image color.
PHP Image Processing