Imagick::sigmoidalContrastImage
(PECL imagick 2, PECL imagick 3)
Imagick::sigmoidalContrastImage — 画像のコントラストを調整する
説明
public Imagick::sigmoidalContrastImage
( bool $sharpen
, float $alpha
, float $beta
[, int $channel
= Imagick::CHANNEL_DEFAULT
] ) : bool
非線形 S 字コントラストアルゴリズムを用いて画像のコントラストを調整します。
S 字変換関数を使用し、ハイライトや影を飽和させることなく画像のコントラストを強調します。
contrast は、どの程度コントラストを向上させるかを表します
(0 は何もしない、3 は一般的な程度、20 は押し出す)
mid-point は、結果の画像での中間色の扱いを表します
(0 は白、50 はグレー、100 は黒)。sharpen を true
にするとコントラストを強め、それ以外にするとコントラストを弱めます。
» ImageMagick v6 Examples - Image Transformations — Sigmoidal Non-linearity Contrast も参照ください。
パラメータ
sharpen
- If true increase the contrast, if false decrease the contrast.
alpha
- The amount of contrast to apply. 1 is very little, 5 is a significant amount, 20 is extreme.
beta
- Where the midpoint of the gradient will be. This value should be in the range 0 to 1 - mutliplied by the quantum value for ImageMagick.
channel
- Which color channels the contrast will be applied to.
返り値
成功した場合に true
を返します。
例
例1 Imagick::sigmoidalContrastImage() によるグラデーションの作成 (ふたつの画像を、$contrast と $midpoint の定義でブレンドする)
<?phpfunction generateBlendImage($width, $height, $contrast = 10, $midpoint = 0.5) { $imagick = new Imagick(); $imagick->newPseudoImage($width, $height, 'gradient:black-white'); $quanta = $imagick->getQuantumRange(); $imagick->sigmoidalContrastImage(true, $contrast, $midpoint * $quanta["quantumRangeLong"]); return $imagick; }?>
エラー / 例外
エラー時に ImagickException をスローします。