imagecolortransparent() function in PHP

The imagecolortransparent() function is used to set the color of a transparent image.

Syntax

imagecolortransparent ( img, color )

Parameters

  • img: Create image with imagecreatetruecolor() function.

  • color: Color identifier created with imagecolorallocate().

Return

The imagecolortransparent() function returns the identifier of the new transparent color. The return value is -1 if color is not specified and the image has no transparent color.

Example

The following is an example

Output

The following is the output:

Updated on: 2019-12-31T07:58:19+05:30

352 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements