Open In App

PHP | Imagick getImageInterlaceScheme() Function

The Imagick::getImageInterlaceScheme() function is an inbuilt function in PHP which is used to get the image interlace scheme.

Syntax:



int Imagick::getImageInterlaceScheme( void )

Parameters: This function does not accept any parameter.

Return Value: This function returns an integer value containing the interlace scheme which corresponds to one of INTERLACE constants.



List of INTERLACE constants are given below:

Exceptions: This function throws ImagickException on error.

Below given program illustrates the Imagick::getImageInterlaceScheme() function in PHP:
Program 1:




<?php
// Create a new imagick object
$imagick = new Imagick(
  
// Get the Interlace Scheme
$interlaceScheme = $imagick->getImageInterlaceScheme();
echo $interlaceScheme;
?>

Output:

1

Program 2:




<?php
// Create a new imagick object
$imagick = new Imagick(
  
// Set the Interlace Scheme
$imagick->setImageInterlaceScheme(imagick::INTERLACE_PNG);
  
// Get the Interlace Scheme
$interlaceScheme = $imagick->getImageInterlaceScheme();
echo $interlaceScheme;
?>

Output:

7

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

Article Tags :