Open In App

PHP | Imagick setImageWhitePoint() Function

Last Updated : 13 Dec, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
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
<?php

// Create a new imagick object
$imagick = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png');

// 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
<?php

// Create a new imagick object
$imagick = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png');

// 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

Similar Reads