PHP | Imagick setImageExtent() Function Last Updated : 19 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::setImageExtent() function is an inbuilt function in PHP which is used to set the image size. This function doesn't scales the image but crops the unwanted parts. Syntax: bool Imagick::setImageExtent( int $columns, int $rows ) Parameters: This function accepts two parameters as mentioned above and described below: $columns: It specifies the width of image. $rows: It specifies the height of image. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::setImageExtent() 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 image extent $imagick->setImageExtent(270, 120); // Display the image header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Set image extent $imagick->setImageExtent(500, 170); // Display the image header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.setimageextent.php Comment More infoAdvertise with us Next Article PHP | Imagick setImageExtent() Function gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick setImageType() Function The Imagick::setImageType() function is an inbuilt function in PHP which is used to set the image type.Syntax:  bool Imagick::setImageType( int $image_type ) Parameters: This function accepts a single parameter $image_type which contains an integer value corresponding to one of IMGTYPE constants. W 1 min read PHP | Imagick setImageScene() Function The Imagick::setImageScene() function is an inbuilt function in PHP which is used to set the image scene. The value of scene contains an integer value. Syntax: bool Imagick::setImageScene( int $scene ) Parameters: This function accepts a single parameter $scene which holds the scene. Return Value: T 1 min read PHP | Imagick setImageDepth() Function The Imagick::setImageDepth() function is an inbuilt function in PHP which is used to set the depth of a particular image.Syntax:  bool Imagick::setImageDepth( $depth ) Parameters: This function accepts a single parameter $depth which is an integer value and used to set the depth of image.Return Val 2 min read PHP | Imagick setImageUnits() Function The Imagick::setImageUnits() function is an inbuilt function in PHP which is used to set the units of resolution of a particular image.Syntax:  bool Imagick::setImageUnits( $units ) Parameters: This function accepts single parameter $units which is used to specify the units to be set for image. Res 2 min read PHP | Imagick setImageIndex() Function The Imagick::setImageIndex() function is an inbuilt function in PHP which is used to set the iterator position. Syntax: bool Imagick::setImageIndex( int $index ) Parameters: This function accepts a single parameter $index which holds the index. Return Value: This function returns TRUE on success. Ex 1 min read PHP | Imagick setImageMatte() Function The Imagick::setImageMatte() function is an inbuilt function in PHP which is used to set the matte channel of an Imagick object. Syntax: bool Imagick::setImageMatte( $matte ) Parameters: This function accepts single parameter $matte. If the parameter set to True then it activate the matte channel an 2 min read PHP | Imagick setImageWhitePoint() Function The Imagick::setImageWhitePoint() function is an inbuilt function in PHP which is used to set the image chromaticity white point. Syntax: bool Imagick::setImageWhitePoint( float $x, float $y ) Parameters:This function accepts two parameters as mentioned above and described below: $x: It specifies th 1 min read PHP | Imagick setImagePage() Function The Imagick::setImagePage() function is an inbuilt function in PHP which is used to set the image page geometry. Syntax: bool Imagick::setImagePage(int $width, int $height, int $x, int $y ) Parameters: This function accepts four parameters as mentioned above and described below: $width: It specifies 1 min read PHP | Imagick setImageProperty() Function The Imagick::setImageProperty() function is an inbuilt function in PHP which is used to set the image property. The main difference between image properties and image artifacts is that the properties are public whereas artifacts are private. Syntax: bool Imagick::setImageProperty( string $name, stri 1 min read PHP | Imagick setImageFormat() Function The Imagick::setImageFormat() function is an inbuilt function in PHP which is used to set the format of a particular image in a sequence.Syntax:  bool Imagick::setImageFormat( string $format ) Parameters: This function accepts a single parameter $format which holds a string value of the image forma 1 min read Like