Open In App

PHP | Imagick setImageBluePrimary() Function

Last Updated : 20 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The Imagick::setImageBluePrimary() function is an inbuilt function in PHP which is used to set the image chromaticity blue primary point.

Syntax:

bool Imagick::setImageBluePrimary( float $x, float $y )

Parameters: This function accept two parameters as mentioned above and described below:

  • $x: It specifies the blue primary x-point.
  • $y: It specifies the blue primary y-point.

Return Value: This function returns TRUE on success.

Exceptions: This function throws ImagickException on error.

Below programs illustrate the Imagick::setImageBluePrimary() function in PHP:

Program 1:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Use setImageBluePrimary() function
$imagick->setImageBluePrimary(10, 10);
  
// Use getImageBluePrimary() function
$result = $imagick->getImageBluePrimary();
  
print_r($result);
?>


Output:

Array ( [x] => 10 [y] => 10 )

Program 2:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Use setImageBluePrimary() function
$imagick->setImageBluePrimary(0.2, 0.2);
  
// Display the image
$imagick->setformat('png');
  
header("Content-Type: image/png");
echo $imagick->getImageBlob();
?>


Output:

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



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads