Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

PHP | Imagick sepiaToneImage() Function

  • Last Updated : 17 Dec, 2019

The Imagick::sepiaToneImage() function is an inbuilt function in PHP which is used to apply a special effect to the image, similar to the effect achieved in a photo darkroom by sepia toning.

Syntax:

bool Imagick::sepiaToneImage( float $threshold )

Parameters: This function accepts a single parameter $threshold which holds the measure of the extent of the sepia toning.

Return Value: This function returns TRUE on success.

Exceptions: This function throws ImagickException on error.

Below given programs illustrate the Imagick::sepiaToneImage() function in PHP:

Program 1:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Apply sepia tone to image
$imagick->sepiaToneImage(20);
  
// Display the image
header("Content-Type: image/png");
echo $imagick->getImageBlob();
?>

Output:

Program 2:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Apply sepia tone to image
$imagick->sepiaToneImage(90);
  
// Display the image
header("Content-Type: image/png");
echo $imagick->getImageBlob();
?>

Output:

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!