HomeLanguagesPHP | Imagick setImageWhitePoint() Function

PHP | Imagick setImageWhitePoint() Function

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

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32717 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7096 POSTS0 COMMENTS
Nicole Veronica
12233 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12318 POSTS0 COMMENTS
Shaida Kate Naidoo
7214 POSTS0 COMMENTS
Ted Musemwa
7475 POSTS0 COMMENTS
Thapelo Manthata
7197 POSTS0 COMMENTS
Umr Jansen
7175 POSTS0 COMMENTS