PHP | Imagick optimizeImageLayers() Function
Last Updated :
10 Jun, 2022
The Imagick::optimizeImageLayers() function is an inbuilt function in PHP which is used to remove the repeated portions of images to optimize. This function compares each image the GIF disposed forms of the previous image in the sequence.
Syntax:
bool Imagick::optimizeImageLayers( void)
Parameters: This function does not accepts any parameters.
Return Value: This function returns TRUE on success.
Errors/Exceptions: This function throws ImagickException on error.
Below programs illustrate the Imagick::optimizeImageLayers() function in PHP:
Program:
php
<?php
$imagick = new Imagick(
$imagick ->optimizeImageLayers();
header("Content-Type: image/jpg");
echo $imagick ->getImageBlob();
?>
|
Output:
Reference: https://www.php.net/manual/en/imagick.optimizeimagelayers.php
Share your thoughts in the comments
Please Login to comment...