You are here

function filtersie_sharpen in FiltersIE 7

Sharpen an image given a sharpen level. It use convolution.

Parameters

$image: An image object returned by image_load().

$sharpenlevel: The sharpenlevel to be applied.

Return value

TRUE or FALSE, based on success.

See also

image_load()

image_gd_filtersie_sharpen()

1 call to filtersie_sharpen()
filtersie_sharpen_effect in ./filtersie.module
Image effect callback; Sharpen an image resource.

File

./filtersie.module, line 180
Filters Image Effect (filtersie)

Code

function filtersie_sharpen($image, $sharpenlevel) {
  $sharpenlevel = $sharpenlevel / 100;
  $matrix = array(
    array(
      -$sharpenlevel,
      -$sharpenlevel,
      -$sharpenlevel,
    ),
    array(
      -$sharpenlevel,
      8 * $sharpenlevel + 1,
      -$sharpenlevel,
    ),
    array(
      -$sharpenlevel,
      -$sharpenlevel,
      -$sharpenlevel,
    ),
  );
  $divisor = 1;
  $offset = 0;
  return image_toolkit_invoke('filtersie_convolution', $image, array(
    $matrix,
    $divisor,
    $offset,
  ));
}