Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP imagecolorallocatealpha - Allocate a Color and Transparency for an Image

PHP imagecolorallocatealpha - Allocate a Color and Transparency for an Image

PHP Image ProcessingPHP Image Processing

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

PHP Image ProcessingPHP Image Processing