PHP | Imagick setSize() Function Last Updated : 28 Nov, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The Imagick::setSize() function is an inbuilt function in PHP which is used to set the size associated with an imagick object. Syntax: bool Imagick::setSize( int $columns, int $rows ) Parameters: This function accepts two parameters as mentioned above and described below: $columns: It specifies the width in pixels. $rows: It specifies the height in pixels. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below given programs illustrate the Imagick::setSize() function in PHP: Program 1: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Set the size $imagick->setSize('500', '800'); // Get the size $size = $imagick->getSize(); print("<pre>".print_r($size, true)."</pre>"); ?> Output: Array ( [columns] => 500 [rows] => 800 ) Program 2: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Set the size $imagick->setSize('250', '900'); // Get the size $size = $imagick->getSize(); print("<pre>".print_r($size, true)."</pre>"); ?> Output: Array ( [columns] => 250 [rows] => 900 ) Reference: https://www.php.net/manual/en/imagick.setsize.php Comment More infoAdvertise with us Next Article PHP | ImagickDraw setFontSize() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Gmagick setsize() Function The Gmagick::setsize() function is an inbuilt function in PHP which is used to set the size associated with an gmagick object. Syntax: Gmagick Gmagick::setsize( int $columns, int $rows ) Parameters: This function accept two parameters as mentioned above and described below: $columns: It specifies th 1 min read PHP | Imagick setPointSize() Function The Imagick::setPointSize() function is an inbuilt function in PHP which is used to set the point size of imagick object. Syntax: bool Imagick::setPointSize( int $point_size ) Parameters: This function accepts a single parameter $point_size which holds the size of point. Return Value: This function 1 min read PHP | Imagick setSizeOffset() Function The Imagick::setSizeOffset() function is an inbuilt function in PHP which is used to set the size and offset of the Imagick object. Syntax: bool Imagick::setSizeOffset( int $columns, int $rows, int $offset ) Parameters: This function accepts three parameters as mentioned above and described below: $ 1 min read PHP | Imagick setPage() Function The Imagick::setPage() function is an inbuilt function in PHP which is used to set the page geometry of the Imagick object. Syntax: bool Imagick::setPage( int $width, int $height, int $x, int $y ) Parameters:This function accepts four parameters as mentioned above and described below: $width: It spe 2 min read PHP | ImagickDraw setFontSize() Function The ImagickDraw::setFontSize() function is an inbuilt function in PHP which is used to set the font point size. It is used when annotating with text. Syntax:  bool ImagickDraw::setFontSize( $pointsize ) Parameters: This function accepts a single parameter $pointsize which is used to hold the value 2 min read PHP | Imagick resizeImage() Function The Imagick::resizeImage() function is an inbuilt function in PHP which is used to scale an image to the desired dimensions. Syntax: bool Imagick::resizeImage( int $columns, int $rows, int $filter, float $blur, bool $best_fit = false, bool $legacy = false ) Parameters: This function accepts six para 2 min read Like