PHP | Imagick getImageExtrema() Function

The Imagick::getImageExtrema() function is an inbuilt function in PHP which is used to get the extrema for an image. Extrema are the points at which a maximum or minimum value of a function is observed.

Syntax:

array Imagick::getImageExtrema( void )

Parameters: This function doesn’t accept any parameters.

Exceptions: This function throws ImagickException on error.

Return Value: This function returns an associative array containing the keys as “min” and “max”.



Below programs illustrate the Imagick::getImageExtrema() function in PHP:

Program 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// Create new imagick object
$imagick = new Imagick(
  
// Get the extrema
$extrema = $imagick->getImageExtrema();
  
print_r($extrema);
?>

chevron_right


Output:

Array ( [min] => 0 [max] => 65535 )

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// Create new imagick object
$imagick = new Imagick(
  
// Get the extrema
$extrema = $imagick->getImageExtrema();
  
print_r($extrema);
?>

chevron_right


Output:

Array ( [min] => 0 [max] => 65535 )

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

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

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.