PHP imagealphablending - Set the Blending Mode of the Image
imagealphablending — Sets the blending mode of the image.
Syntax
bool imagealphablending ( resource $image , bool $blendmode )
imagealphablending() allows two different drawing modes to be used on true-color images.
In blending mode, the alpha channel color component is provided to all drawing functions, such as imagesetpixel(), which determines the extent to which the underlying color is allowed to show through. As a result, GD automatically blends the existing color of that point with the brush color and stores the result in the image. The resulting pixel is opaque.
In non-blending mode, the brush color along with its alpha channel information is copied, replacing the destination pixel. Blending mode is unavailable when drawing palette images.
If blendmode is TRUE, blending mode is enabled; otherwise it is disabled. Returns TRUE on success, or FALSE on failure.
Parameters
- ** image** The image resource returned by an image creation function (e.g., imagecreatetruecolor()).
- ** blendmode** Whether blending mode is enabled. True-color images default to True, otherwise FALSE.
Return Value
Returns TRUE on success, or FALSE on failure.
Example
PHP Image Processing