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

PHP imagecolortransparent - Define a Color as Transparent

PHP imagecolortransparent - Define a Color as Transparent

PHP Image ProcessingPHP Image Processing

imagecolortransparent — Defines a color as transparent.

Syntax



int imagecolortransparent ( resource $image [, int $color ] )

imagecolortransparent() sets the transparent color of the image image to color. image is imagecreatetruecolor() the returned image identifier, color is imagecolorallocate() the returned color identifier.

**Note:** Transparency is a property of the image, not of the color. Once a color is set as transparent, any area previously drawn in that color in the image becomes transparent.

Returns the identifier of the new transparent color, or the identifier of the current transparent color if color is omitted.

**Note:** Transparency can only be achieved through imagecopymerge() and copying from true-color images; it cannot be done with imagecopy() or palette images.

PHP Image ProcessingPHP Image Processing