PHP | ImagickDraw setFillAlpha() Function Last Updated : 30 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickDraw::setFillAlpha() function is an inbuilt function in PHP which is used to set the opacity to use when drawing using the fill color or fill texture. Syntax: bool ImagickDraw::setFillAlpha( float $opacity ) Parameters: This function accepts a single parameter $opacity which holds the opacity of the color where 1 means opaque and 0 means transparent. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below given programs illustrate the ImagickDraw::setFillAlpha() function in PHP: Program 1: php <?php // Create a new imagick object $imagick = new Imagick(); // Create a image on imagick object $imagick->newImage(800, 250, 'white'); // Create a new imagickDraw object $draw = new ImagickDraw(); // Set the color to green $draw->setFillColor('green'); // Set the opacity $draw->setFillAlpha(0.3); // Set the font size $draw->setFontSize(80); // Annotate a text $draw->annotation(100, 150, 'GeeksforGeeks'); // Render the draw commands $imagick->drawImage($draw); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick(); // Create a image on imagick object $imagick->newImage(800, 250, 'white'); // Create a new imagickDraw object $draw = new ImagickDraw(); // Set the color to green $draw->setFillColor('green'); // Set the opacity $draw->setFillAlpha(0.3); // Draw a circle $draw->circle(300, 200, 230, 20); // Set the color to red $draw->setFillColor('red'); // Set the opacity $draw->setFillAlpha(0.5); // Draw a rectangle $draw->rectangle(200, 300, 20, 100); // Render the draw commands $imagick->drawImage($draw); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagickdraw.setfillalpha.php Comment More infoAdvertise with us Next Article PHP | ImagickDraw setStrokeAlpha() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | ImagickDraw setFillRule() Function The ImagickDraw::setFillRule() function is an inbuilt function in PHP which is used to set the fill rule to use while drawing the polygons. Syntax: bool ImagickDraw::setFillRule( int $fill_rule ) Parameters: This function accepts a single parameter $fill_rule which holds an integer value correspondi 2 min read PHP | ImagickDraw setFillColor() Function The ImagickDraw::setFillColor() function is an inbuilt function in PHP which is used to set the fill color to be used for drawing. Syntax: bool ImagickDraw::setFillColor( $fill_pixel ) Parameters: This function accepts single parameter $fill_pixel which is used to hold the value of pixel color. Retu 2 min read PHP | ImagickDraw setFillOpacity() Function The ImagickDraw::setFillOpacity() function is an inbuilt function in PHP which is used to set the opacity to use when drawing using the fill color or fill texture.Syntax:Â bool ImagickDraw::setFillOpacity( $fillOpacity ) Parameters: This function accepts a single parameter $fillOpacity which is used 2 min read PHP | ImagickDraw setStrokeAlpha() Function The ImagickDraw::setStrokeAlpha() function is an inbuilt function in PHP which is used to specify the opacity of stroked object outlines. Syntax: bool ImagickDraw::setStrokeAlpha( $opacity ) Parameters: This function accepts a single parameter opacity which is used to specify the transparency of str 2 min read PHP | GmagickDraw setfillopacity() Function The GmagickDraw ::setfillopacity() function is an inbuilt function in PHP which is used to set the opacity of a drawing image. It is used when drawing the image using the filled color or filled texture. Syntax: public GmagickDraw::setfillopacity( $fill_opacity ) : GmagickDraw Parameters: This functi 2 min read PHP | ImagickDraw setFillPatternURL() Function The ImagickDraw::setFillPatternURL() function is an inbuilt function in PHP which is used to set the URL to use as a fill pattern for filling objects. The URL actually is a unique name of a pattern with a '#' before the name. Syntax: bool ImagickDraw::setFillPatternURL( string $fill_url ) Parameters 2 min read Like