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 // Declare an Imagick object $imagick = new \Imagick( // Use Imagick::liquidRescaleImage() function $imagick->liquidRescaleImage( 500, 200, 3, 25 ); header( 'Content-Type: image/jpg' ); // Dsiplay the output echo $imagick->getImageBlob(); ?> |
Output:

Reference: https://www.php.net/manual/en/imagick.liquidrescaleimage.php
Recommended Posts:
- PHP | Imagick getImageGamma() Function
- PHP | Imagick getImageColorspace() Function
- PHP | Imagick getImageColors() Function
- PHP | Imagick shadeImage() Function
- PHP | Imagick vignetteImage() Function
- PHP | Imagick magnifyImage() Function
- PHP | Imagick brightnessContrastImage() Function
- PHP | Imagick getImageSignature() Function
- PHP | Imagick getImageTicksPerSecond() Function
- PHP | Imagick getInterlaceScheme() Function
- PHP | Imagick flipImage() Function
- PHP | Imagick radialBlurImage() Function
- PHP | Imagick randomThresholdImage() Function
- PHP | Imagick identifyImage() Function
- PHP | Imagick rollImage() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



