PHP | Imagick getImageUnits() Function Last Updated : 03 Mar, 2021 Comments Improve Suggest changes Like Article Like Report The Imagick::getImageUnits() function is an inbuilt function in PHP which is used to get the units of resolution of a particular image. Syntax: int Imagick::getImageUnits( void ) Parameters: This function does not accepts any parameter.Return Value: This function returns an integer of the image units of resolution.Below programs illustrate the Imagick::getImageUnits() function in PHP: Program 1: Original Image: php <?php // PHP program to illustrate getimageunits function $image = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-15.png'); // Use getImageUnits Function $unit = $image->getImageUnits(); // Display the output echo "</br>units = "; print_r($unit); ?> Output: Units = 2 Program 2: php <?php $string = "Computer Science portal for Geeks!"; // creating new image of above String // and add color and background $im = new Imagick(); $draw = new ImagickDraw(); // Fill the color in image $draw->setFillColor(new ImagickPixel('green')); // Set the text font size $draw->setFontSize(50); $metrix = $im->queryFontMetrics($draw, $string); $draw->annotation(0, 40, $string); $im->newImage($metrix['textWidth'], $metrix['textHeight'], new ImagickPixel('white')); // Draw the image $im->drawImage($draw); // Imagick function to gets // units of created image $res= $im->getImageUnits(); // Display the units of image echo "Units = "; print_r($res); ?> Output: Units = 0 Reference: http://php.net/manual/en/imagick.getimageunits.php Comment More infoAdvertise with us Next Article PHP | Imagick getImageUnits() Function R R_Raj Follow Improve Article Tags : Misc Web Technologies PHP Image-Processing PHP-function PHP-Imagick +2 More Practice Tags : Misc Similar Reads PHP | Imagick getImageWidth() Function The Imagick::getImageWidth() function is an inbuilt function in PHP which is used to get the width of the image. Syntax: int Imagick::getImageWidth( void ) Parameters: This function does not accepts any parameters. Return Value: This function returns the image width in pixels. Original Image Below p 1 min read PHP | Imagick getImageLength() Function The Imagick::getImageLength() function is an inbuilt function in PHP which is used to get the length of an image object in bytes. Syntax: bool Imagick::getImageLength( void) Parameters: This function does not accept any parameter. Return Value: This function returns the image length in bytes. Below 1 min read PHP | Imagick getImageSize() Function The Imagick::getImageSize() function is an inbuilt function in PHP which is used to get the image length in bytes. Syntax: int Imagick::getImageSize( void ) Parameters: This function doesnât accepts any parameter. Return Value: This function returns an integer value containing the current image size 1 min read PHP | Imagick getImageType() Function The Imagick::getImageType() function is an inbuilt function in PHP which is used to get the potential image type. Syntax: int Imagick::getImageType( void ) Parameters: This function doesnât accepts any parameter. Return Value: This function returns an integer value corresponding to one of IMGTYPE co 1 min read PHP | Imagick getImageHeight() Function The Imagick::getImageHeight() function is an inbuilt function in PHP which is used to get the height of the image. Syntax: int Imagick::getImageHeight( void ) Parameters: This function does not accepts any parameter. Return Value: This function returns the image height in pixels. Original Image: Bel 1 min read PHP | imagick getImageDispose() Function The Imagick::getImageDispose() function is an inbuilt function in PHP which is used to get the image disposal method. Syntax: int Imagick::getImageDispose( void) Parameters: This function does not accept any parameter. Return Value: This function returns the dispose method on success. Below programs 1 min read PHP | Imagick getImageScene() Function The Imagick::getImageScene() function is an inbuilt function in PHP which is used to get the image scene of an Imagick object. Syntax: int Imagick::getImageScene( void ) Parameters: This function does not accept any parameter. Return Value: This function returns the image scene. Below programs illus 1 min read PHP | Imagick getImageIndex() Function The Imagick::getImageIndex() function is an inbuilt function in PHP which is used to get the index of the current image. Syntax: int Imagick::getImageIndex( void ) Parameters: This function does not accept any parameter. Return Value: This function returns an integer value containing the index of th 1 min read PHP | Imagick getImagesBlob() Function The Imagick::getImageBlob() function is an inbuilt function in PHP which is used to get the all the image sequences as a blob. This function is useful for animated gifs as doing getImageBlob() on them won't work. This function implements direct to memory image formats. Syntax: string Imagick::getIma 1 min read PHP | Imagick getImageMatte() Function The Imagick::getImageMatte() function is an inbuilt function in PHP which is used to get the matte channel of an imagick object.Syntax:Â Â bool Imagick::getImageMatte( void ) Parameters: This function does not accept any parameter.Return Value: This function returns True if image has a matte channel 1 min read Like