HomeLanguagesPHP | Imagick getImageInterpolateMethod() Function

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:

  • imagick::INTERPOLATE_UNDEFINED (0)
  • imagick::INTERPOLATE_AVERAGE (1)
  • imagick::INTERPOLATE_BICUBIC (2)
  • imagick::INTERPOLATE_BILINEAR (3)
  • imagick::INTERPOLATE_FILTER (4)
  • imagick::INTERPOLATE_INTEGER (5)
  • imagick::INTERPOLATE_MESH (6)
  • imagick::INTERPOLATE_NEARESTNEIGHBOR (7)
  • imagick::INTERPOLATE_SPLINE (8)

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

RELATED ARTICLES

4 COMMENTS

Most Popular

Dominic
32688 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7057 POSTS0 COMMENTS
Nicole Veronica
12198 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12293 POSTS0 COMMENTS
Shaida Kate Naidoo
7182 POSTS0 COMMENTS
Ted Musemwa
7447 POSTS0 COMMENTS
Thapelo Manthata
7160 POSTS0 COMMENTS
Umr Jansen
7150 POSTS0 COMMENTS