Thursday, June 18, 2026
HomeLanguagesPHP | Imagick previewImages() Function

PHP | Imagick previewImages() Function

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. 

Syntax:

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: 

Program: 

php




<?php
 
// Store the image source into variable
$imagePath =
"https://cdncontribute.geeksforgeeks.org/wp-content/uploads/neveropen-9.png";
 
// Create new Imagick object
$imagick = new \Imagick($imagePath);
 
// Use previewImages() function
$imagick->previewImages(imagick::PREVIEW_EDGEDETECT);
 
header("Content-Type: image/png");
 
// Display output image
echo $imagick->getImageBlob();
 
?>


Output:

  

Reference: https://www.php.net/manual/en/imagick.previewimages.php

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32516 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6898 POSTS0 COMMENTS
Nicole Veronica
12014 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6965 POSTS0 COMMENTS