The ImagickDraw::setTextAntialias() function is an inbuilt function in PHP which is used to control whether the text is antialiased. The text is antialiased by default.
Syntax:
bool ImagickDraw::setTextAntialias( $antiAlias )
Parameters: This function accepts a single parameter $antiAlias which is used to store the Boolean Signal i.e. TRUE/FALSE.
Return Value: This function does not return any value.
Below programs illustrate the ImagickDraw::setTextAntialias() function in PHP:
Program 1:
<?php // Create an ImagickDraw object $draw = new ImagickDraw(); // Set the image filled color $draw->setFillColor('green'); // Set the font size $draw->setFontSize(50); // Set the Text Antialias $draw->setTextAntialias(false); // Set the text to be added $draw->annotation(50, 75, "Gfg!"); // Create new Imagick object $imagick = new Imagick(); // Set the image dimensions $imagick->newImage(500, 160, 'black'); // Set the image format $imagick->setImageFormat("png"); // Draw the image $imagick->drawImage($draw); header("Content-Type: image/png"); // Display the image echo $imagick->getImageBlob(); ?> |
Output:

Program 2:
<?php // Create an ImagickDraw object $draw = new ImagickDraw(); // Set the image filled color $draw->setFillColor('orange'); // Set the font size $draw->setFontSize(50); // Set the TextAntialias function $draw->setTextAntialias(true); // Set the text to be added $draw->annotation(5, 75, "Gfg!"); // Set the TextAntialias function $draw->setTextAntialias(false); // Set the text to be added $draw->annotation(105, 75, "Gfg!"); // Create new Imagick object $imagick = new Imagick(); // Set the image dimensions $imagick->newImage(300, 160, 'green'); // Set the image format $imagick->setImageFormat("png"); // Draw the image $imagick->drawImage($draw); header("Content-Type: image/png"); // Display the image echo $imagick->getImageBlob(); ?> |
Output:

Reference: http://php.net/manual/en/imagickdraw.settextantialias.php
Recommended Posts:
- PHP | ImagickDraw getTextAlignment() Function
- PHP | ImagickDraw scale() Function
- PHP | ImagickDraw polygon() Function
- PHP | ImagickDraw roundRectangle() Function
- PHP | ImagickDraw arc() Function
- PHP | ImagickDraw circle() Function
- PHP | ImagickDraw bezier() Function
- PHP | ImagickDraw rectangle() Function
- PHP | ImagickDraw line() Function
- PHP | ImagickDraw point() Function
- PHP | ImagickDraw skewX() Function
- PHP | ImagickDraw setStrokeWidth() Function
- PHP | ImagickDraw translate() Function
- PHP | ImagickDraw setStrokeOpacity() Function
- PHP | ImagickDraw setGravity() Function
- PHP | ImagickDraw setFillColor() Function
- PHP | ImagickDraw setFont() Function
- PHP | ImagickDraw setFontStyle() Function
- PHP | ImagickDraw setFontFamily() Function
- PHP | ImagickDraw setFontSize() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

