Friday, October 17, 2025
HomeLanguagesPHP | Imagick getImageExtrema() Function

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:




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


Output:

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

Program 2:




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


Output:

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

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

RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS