Open In App

PHP | Imagick blueShiftImage() Function

Last Updated : 16 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report
The Imagick::blueShiftImage() function is an inbuilt function in PHP which is used to mute the colors of the image to simulate a scene at nighttime in the moonlight. Syntax:
bool Imagick::blueShiftImage( $factor)
Parameters: This function accept a single parameter $factor which is used to specify the mutes colors of image. Return Value: This function returns True on success. Below programs illustrate the Imagick::blueShiftImage() function in PHP: Program 1: Original Image: https://media.geeksforgeeks.org/wp-content/uploads/geeks-21.png php
<?php

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


// Using blueShiftImage function
$imagick->blueShiftImage(1.3);

header("Content-Type: image/jpg");
echo $imagick->getImageBlob();

?>
Output: Program 2: Original Image: https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200X200.png php
<?php

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

// Using blueShiftImage function
$imagick->blueShiftImage(2.5);

header("Content-Type: image/jpg");
echo $imagick->getImageBlob();

?>
Output: Reference: http://php.net/manual/en/imagick.blueshiftimage.php

Next Article

Similar Reads