Skip to content
Related Articles

Related Articles

PHP | imagick getImageDispose() Function
  • Last Updated : 26 Aug, 2019
GeeksforGeeks - Summer Carnival Banner

The Imagick::getImageDispose() function is an inbuilt function in PHP which is used to get the image disposal method.


int Imagick::getImageDispose( void)

Parameters: This function does not accept any parameter.

Return Value: This function returns the dispose method on success.

Below programs illustrate the Imagick::getImageDispose() function in PHP:

Program 1:
Original Image:

// Create new Imagick object
$imagick = new Imagick(
// Using getImageDispose function
$res = $imagick->getImageDispose();
// Display result



Program 2:
Original Image:

$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 
$metrix = $im->queryFontMetrics($draw, $string); 
$draw->annotation(0, 40, $string); 
$im->newImage($metrix['textWidth'], $metrix['textHeight'], 
        new ImagickPixel('white')); 
// Draw the image         
// Using getImageDispose function
$res = $im->getImageDispose();
// Display Result




Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :