You are here

function image_imagemagick_sharpen in ImageMagick 7

Sharpens an image.

Parameters

$image: An image object. The $image->resource value will be modified by this call.

$radius: (optional) The radius of the gaussian, in pixels, not counting the center pixel. Defaults to 0.5.

$sigma: (optional) The standard deviation of the gaussian, in pixels. Defaults to 0.5.

$amount: (optional) The percentage of the difference between the original and the blur image that is added back into the original. Defaults to 100.

$threshold: (optional) The threshold, as a fraction of max RGB levels, needed to apply the difference amount. Defaults to 0.05.

Return value

TRUE or FALSE, based on success.

See also

image_sharpen()

File

imagemagick_advanced/imagemagick_advanced.module, line 131
Provides advanced ImageMagick effects and options.

Code

function image_imagemagick_sharpen(stdClass $image, $radius = 0.5, $sigma = 0.5, $amount = 100, $threshold = 0.05) {
  $unsharp_arg = $radius . 'x' . $sigma . '+' . $amount / 100 . '+' . $threshold;
  $image->ops[] = '-unsharp ' . $unsharp_arg;
  return TRUE;
}