The imagelayereffect() function is an inbuilt function in PHP which is used to set the alpha blending flag to use layering effects. This function returns True on success or False on failure.
bool imagelayereffect( $image, $effect )
Parameters: This function accepts two parameters as mentioned above and described below:
- $image: It is returned by one of the image creation functions, such as imagecreatetruecolor(). It is used to create size of image.
- $effect: This parameter set the value of effect constant. The value of effect constants are listed below:
- IMG_EFFECT_REPLACE: It is used to set the pixel replacement. It is equivalent to passing True to imagealphablending() function.
- IMG_EFFECT_ALPHABLEND: It is used to set the normal pixel blending. It is equivalent to passing False to imagealphablending() function.
- IMG_EFFECT_NORMAL: It is same as IMG_EFFECT_ALPHABLEND.
- IMG_EFFECT_OVERLAY: It is the effect where black background pixels will remain black, white background pixels will remain white but grey background pixels will take the color the foreground pixel.
- IMG_EFFECT_MULTIPLY: It sets the multiply effect.
Return Value: This function returns True on success or False on failure.
Below programs illustrate the imagelayereffect() function in PHP:
This article is attributed to GeeksforGeeks.org