The Imagick::setImageWhitePoint() function is an inbuilt function in PHP which is used to set the image chromaticity white point.
Syntax:
bool Imagick::setImageWhitePoint( float $x, float $y )
Parameters:This function accepts two parameters as mentioned above and described below:
- $x: It specifies the x-coordinate of white point chromaticity.
- $y: It specifies the y-coordinate of white point chromaticity.
Return Value: This function returns TRUE on success.
Exceptions: This function throws ImagickException on error.
Below programs illustrate the Imagick::setImageWhitePoint() function in PHP:
Program 1:
<?php // Create a new imagick object $imagick = new Imagick( // Set the image white point $imagick ->setImageWhitePoint(0.65, 0.89); // Get the image white point $whitepoint = $imagick ->getImageWhitePoint(); print ( "<pre>" .print_r( $whitepoint , true). "</pre>" ); ?> |
Output:
Array ( [x] => 0.65 [y] => 0.89 )
Program 2:
<?php // Create a new imagick object $imagick = new Imagick( // Set the image white point $imagick ->setImageWhitePoint(0.2, 0.2); // Display the image header( "Content-Type: image/png" ); echo $imagick ->getImagesBlob(); ?> |
Output:
Reference: https://www.php.net/manual/en/imagick.setimagewhitepoint.php