Open In App

PHP | Imagick sketchImage() Function

Last Updated : 26 Aug, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The Imagick::sketchImage() function is an inbuilt function in PHP which is used to simulates a pencil sketch. This function convolves the image with a Gaussian operator of the given radius and standard deviation.

Syntax:

bool Imagick::sketchImage( $radius, $sigma, $angle )

Parameters: This function accepts three parameters as mentioned above and described below:

  • $radius: This parameter is used to set the radius of the Gaussian, in pixels, not counting the center pixel.
  • $sigma: This parameter is used to set the standard deviation of the Gaussian, in pixels.
  • $angle: This parameter is used to set the angle to apply the effect.

Return Value: This function returns True on success.

Below program illustrates the Imagick::sketchImage() function in PHP:

Program:




<?php
  
// Create an Imagick object
$imagick = new Imagick(
  
// Use sketchimage function
$imagick->sketchimage(5, 1, 45);
  
header("Content-Type: image/jpg");
  
// Display the output image
echo $imagick->getImageBlob();
?>


Output:
sketch image

Related Articles:

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


Similar Reads

PHP | Imagick floodFillPaintImage() Function
The Imagick floodFillPaintImage() Function is an in-built function in PHP which is used to change the color value of any pixel that matches the target, along with its immediate neighbor pixels of the same color. Note: This method is a replacement for deprecated Imagick::paintFloodFillImage() Function and is available if Imagick has been compiled ag
4 min read
PHP | Imagick adaptiveSharpenImage() Function
The Imagick::adaptiveSharpenImage() function is an inbuilt function in PHP which provides an adaptive sharpen image feature to the image. The intensity of an adaptive sharpen image depends on dramatically decreased at the edge of the image. Syntax: bool Imagick::adaptiveSharpenImage ( $radius, $sigma, $channel ) Parameters: This function accepts th
1 min read
PHP | Imagick flopImage() Function
The Imagick::flopImage() function is an inbuilt function in PHP which is used to create a horizontal mirror image. Syntax: bool Imagick::flopImage( void ) Parameters: This function does not accept any parameter. Return Value: This function returns True on success. Below programs illustrate the Imagick::flopImage() function in PHP: Program 1: Origin
1 min read
PHP | Imagick setImageExtent() Function
The Imagick::setImageExtent() function is an inbuilt function in PHP which is used to set the image size. This function doesn't scales the image but crops the unwanted parts. Syntax: bool Imagick::setImageExtent( int $columns, int $rows ) Parameters: This function accepts two parameters as mentioned above and described below: $columns: It specifies
1 min read
PHP | Imagick getImageWhitePoint() Function
The Imagick::getImageWhitePoint() function is an inbuilt function in PHP which is used to get the chromaticity white point of an Imagick object. Syntax: bool Imagick::getImageWhitePoint( void) Parameters: This function does not accept any parameter. Return Value: This function returns the chromaticity white point as an associative array with the ke
1 min read
PHP | Imagick getCompressionQuality() Function
The Imagick::getCompressionQuality() function is an inbuilt function in PHP which is used to get the object compression quality. Syntax: int Imagick::getCompressionQuality( void ) Parameters: This function does not accept any parameters. Return Value: This function returns an integer value on success. Below programs illustrate the Imagick::getCompr
1 min read
PHP | Imagick clear() Function
The Imagick::clear() function is an inbuilt function in PHP which is used to clear all resource allocated to an Imagick object. Syntax: bool Imagick::clear( void ) Parameters: This function does not accept any parameter. It just clears off the resources of the Imagick object which is used to call the function. Return Value: This function returns tr
2 min read
PHP | Imagick annotateImage() Function
The Imagick::annotateImage() function is an inbuilt function in PHP which is used to annotates an image with text. This function returns True on success. Syntax: bool Imagick::annotateImage( $draw_settings, $x, $y, $angle, $text ) Parameters: This function accepts five parameters as mentioned above and described below: $draw_settings: This paramete
2 min read
PHP | Imagick adaptiveResizeImage() Function
The Imagick::adaptiveResizeImage() function is an inbuilt function in PHP which provides an adaptively resize image feature to the image. The intensity of an adaptive resize image depends on dramatically decreased at the edge of the image. This function is used to resize the image according to web sites. It is useful when it shrinks the images slig
1 min read
PHP | Imagick adaptiveBlurImage() Function
The Imagick::adaptiveBlurImage() function is an inbuilt function in PHP which is used to add adaptive blur filter in the given image. The intensity of an adaptive blur depends is dramatically decreased at the edge of the image, whereas a standard blur is a uniform across the image. This effect makes the image unclear or less distinct. Syntax: bool
2 min read