array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'imagick.contrastimage.php', 1 => 'Imagick::contrastImage', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.construct.php', 1 => 'Imagick::__construct', ), 'next' => array ( 0 => 'imagick.contraststretchimage.php', 1 => 'Imagick::contrastStretchImage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/imagick/imagick/contrastimage.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 2, PECL imagick 3)
Imagick::contrastImage — 画像のコントラストを変更する
画像の中の暗めの部分と明るめの部分の輝度の差を強調します。 sharpen に 0 以外を指定すると画像のコントラストを上げ、 0 を指定するとコントラストを下げます。
sharpen
シャープ値。
成功した場合に true
を返します。
エラー時に ImagickException をスローします。
例1 Imagick::contrastImage()
<?php
function contrastImage($imagePath, $contrastType) {
$imagick = new \Imagick(realpath($imagePath));
if ($contrastType != 2) {
$imagick->contrastImage($contrastType);
}
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>