The Imagick::paintTransparentImage() function is an inbuilt function in PHP which is used to change any pixel that matches the color with the defined color.
bool Imagick::paintTransparentImage( $target, $alpha, $fuzz )
Parameters: This function accepts three parameters as mentioned above and described below:
- $target: It contains the value of target color to change the specified opacity value within the given range.
- $alpha: It contains the floating point value ranging from 0.0(fully transparent) to 1.0(fully opaque).
- $fuzz: It defines how much the tolerance is accepted to consider the two colors as the same.
Return Value: This function returns True on success.
Errors/Exceptions: This function throws ImagickException on error.
Below program illustrates the Imagick::paintTransparentImage() function in PHP: