Open In App

PHP | Imagick getImageInterpolateMethod() Function

The Imagick::getImageInterpolateMethod() function is an inbuilt function in PHP which is used to get the interpolation method for the specified image.

Syntax:



int Imagick::getImageInterpolateMethod( void )

Parameters: This function doesn’t accepts any parameter.

Return Value: This function returns an integer value containing the interpolate method which corresponds to one of INTERPOLATE constants.



List of INTERPOLATE constants are given below:

Exceptions: This function throws ImagickException on error.

Below programs illustrates the Imagick::getImageInterpolateMethod() function in PHP:

Program 1:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
   
// Get the Interpolate Method
$interpolateScheme = $imagick->getImageInterpolateMethod();
echo $interpolateScheme
?>

Output:

0 // which corresponds to imagick::INTERPOLATE_UNDEFINED.

Program 2:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Set the Interpolate Method
$imagick->setImageInterpolateMethod(imagick::INTERPOLATE_MESH);
  
// Get the Interpolate Method
$interpolateScheme = $imagick->getImageInterpolateMethod();
echo $interpolateScheme;
?>

Output:

6 // which corresponds to imagick::INTERPOLATE_MESH

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


Article Tags :