Tutorialspoint.dev

PHP | Imagick blueShiftImage() Function

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 only 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://tutorialspoint.dev/image/geeks-21.png

<?php
  
// Create new imagick object
$imagick = new Imagick(
  
  
// Using blueShiftImage function
$imagick->blueShiftImage(1.3);
  
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
  
?>

/div>

Output:

Program 2:
Original Image:
https://tutorialspoint.dev/image/gfg_200X200.png

<?php
  
// Create new imagick object
$imagick = new Imagick(
  
// Using blueShiftImage function
$imagick->blueShiftImage(2.5);
  
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
  
?>

Output:
https://tutorialspoint.dev/image/GFG-LOGO-FORBLUR.png

Reference: http://php.net/manual/en/imagick.blueshiftimage.php



This article is attributed to GeeksforGeeks.org

You Might Also Like

leave a comment

code

0 Comments

load comments

Subscribe to Our Newsletter