PHP | Imagick setImageIterations() Function Last Updated : 21 Nov, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::setImageIterations() function is an inbuilt function in PHP which is used to set the image iterations. The iteration here actually means for how many times the frames should repeat themselves. Syntax: bool Imagick::setImageIterations( int $iterations ) Parameters: This function accepts a single parameter $iterations which holds the number of iterations. Set to 0 to make it loop forever. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::setImageIterations() function in PHP: Program 1: php <?php // Create a new imagick object $imagickAnimation = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/20191120143630/newanimated.gif'); foreach ($imagickAnimation as $frame) { // Add delay of 3 seconds $frame->setImageDelay(300); } // Set the interations $imagickAnimation = $imagickAnimation->coalesceImages(); $imagickAnimation->setImageIterations(1); // Display the image header("Content-Type: image/gif"); echo $imagickAnimation->getImagesBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagickAnimation = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/20191120143630/newanimated.gif'); // Set the interations to 0 (infinite loop) $imagickAnimation = $imagickAnimation->coalesceImages(); $imagickAnimation->setImageIterations(0); // Display the image header("Content-Type: image/gif"); echo $imagickAnimation->getImagesBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.setimageiterations.php Comment More infoAdvertise with us Next Article PHP | Imagick setImageIterations() Function gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads 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 setImageResolution() Function The Imagick::setImageResolution() function is an inbuilt function in PHP which is used to set the resolution of an image object.Syntax:  bool Imagick::setImageResolution($x_resolution, $y_resolution) Parameters: This function accept two parameters as mentioned above and described below:  $x_resolu 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 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 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 setImageExtent() Function 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 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 setLastIterator() Function The Imagick::setLastIterator() function is an inbuilt function in PHP which is used to set the Imagick iterator to the last image. Syntax: bool Imagick::setLastIterator( void ) Parameters: This function doesnât accepts any parameter. Return Value: This function returns TRUE on success. Exceptions: T 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 setImageInterpolateMethod() Function The Imagick::setImageInterpolateMethod() function is an inbuilt function in PHP which is used to set the interlace scheme of image. Syntax: bool Imagick::setImageInterpolateMethod( int $method ) Parameters: This function accepts a single parameter $method which corresponds to one of INTERPOLATE con 1 min read Like