PHP | Gmagick getimagedepth() Function Last Updated : 28 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Gmagick::getimagedepth() function is an inbuilt function in PHP which is used to gets the depth of the image. Syntax: int Gmagick::getimagedepth( void ) Parameters: This function does not accepts any parameter. Return Value: This function returns the depth of image. Below programs illustrate the Gmagick::getimagedepth() function in PHP: Original Image 1: Program 1: php <?php // require_once('vendor/autoload.php'); // Create an Gmagick Object $image = new Gmagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-15.png'); // Use getimagedepth function to calculate image depth $height = $image->getimagedepth(); // Display the depth of image print_r($height); ?> Output: 8 Original Image 2: Program 2: php <?php $string = "Computer Science portal for Geeks!"; // Creating new image of above String // and add color and background $im = new Gmagick(); $draw = new GmagickDraw(); // Fill the color in image $draw->setFillColor(new GmagickPixel('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 GmagickPixel('white')); // Draw the image $im->drawImage($draw); $im->setImageFormat('jpeg'); $dpth = $im->getimagedepth(); // Display the depth of image print_r($dpth); ?> Output: 8 Reference: http://php.net/manual/en/gmagick.getimagedepth.php Comment More infoAdvertise with us Next Article PHP | Gmagick getimagedepth() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP Image-Processing PHP-function PHP-Gmagick +1 More Similar Reads PHP | Imagick getImageDepth() Function The Imagick::getImageDepth() function is an inbuilt function in PHP which is used to gets the depth of the image. Syntax: int Imagick::getImageDepth( void ) Parameters: This function does not accepts any parameter. Return Value: This function returns the image depth. Below programs illustrate the Im 1 min read PHP | Gmagick getimagewidth() Function The Gmagick::getimagewidth() function is an inbuilt function in PHP which is used to get the image width which is the horizontal length of the image. Syntax: int Gmagick::getimagewidth( void ) Parameters:This function doesnât accept any parameter. Return Value: This function returns an integer value 1 min read PHP | Gmagick getimagedelay() Function The Gmagick::getimagedelay() function is an inbuilt function in PHP which is used to get the image delay. The delay is actually the time taken for the transition from one image to another in a gif animation. Syntax: int Gmagick::getimagedelay( void ) Parameters: This function doesnât accepts any par 1 min read PHP | Gmagick getimagechanneldepth() Function The Gmagick::getimagechanneldepth() function is an inbuilt function in PHP which is used to return the depth for channel image.Syntax:Â Â int Gmagick::getimagechanneldepth( $channel_type ) Parameters: This function accepts a single parameter $channel_type which holds the channel constant that is vali 2 min read 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 Like