Skip to content
Related Articles
Open in App
Not now

Related Articles

PHP | Imagick previewImages() Function

Improve Article
Save Article
  • Last Updated : 16 Jun, 2022
Improve Article
Save Article

The Imagick::previewImages() function is an inbuilt function in PHP which is used to quickly pin-point appropriate parameters for image processing. It tiles 9 thumbnails of the specified image with an image processing operation applied at varying strengths. 


bool Imagick::previewImages( int $preview )

Parameters: This function accepts single parameter $preview which holds the preview type constants. Click here to get the list of preview type constants. 

Return Value: This function returns TRUE on success and FALSE on Error or Failure. 

Errors/Exceptions: It throws ImagickException while error occurred. 

Below program illustrates the Imagick::previewImages() function in PHP: 



// Store the image source into variable
$imagePath =
// Create new Imagick object
$imagick = new \Imagick($imagePath);
// Use previewImages() function
header("Content-Type: image/png");
// Display output image
echo $imagick->getImageBlob();




My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!