PHP | Imagick liquidRescaleImage() Function
The Imagick::liquidRescaleImage() function is an inbuilt function in PHP which is used to animate an image or images. This function mainly rescaling the images. This function scales the images using liquid rescaling method, which is an implementation of a technique called seam carving.
Syntax:
bool Imagick::liquidRescaleImage( $width, $height, $delta_x, $rigidity )
Parameters: This function accepts four parameters as mentioned above and described below:
- $width: This parameter holds the width of the target image.
- $height: This parameter holds the height of the target image.
- $delta_x: It defines how much seams traverse on x-axis. The value 0 represents the straight seams.
- $rigidity: It is used for bias non-straight seams. This parameter is typically 0.
Return Value: This function returns True on success or False on failure.
Below program illustrates the Imagick::liquidRescaleImage() function in PHP:
Program:
php
<?php
$imagick = new \Imagick(
$imagick ->liquidRescaleImage( 500, 200, 3, 25 );
header( 'Content-Type: image/jpg' );
echo $imagick ->getImageBlob();
?>
|
Output:
Reference: https://www.php.net/manual/en/imagick.liquidrescaleimage.php
Last Updated :
29 Nov, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...