Sunday, September 22, 2024
Google search engine
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 Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments