Imagick::deskewImage

(PECL imagick 2 >= 2.3.0, PECL imagick 3 >= 3.3.0)

Imagick::deskewImage傾きを除去する

説明

publicImagick::deskewImage(float$threshold): bool

このメソッドを使うと、スキャナでの読み込み時にうまく紙を置かなかった場合などの画像の傾きを除去することができます。 このメソッドは、ImageMagick バージョン 6.4.5 以降で Imagick をコンパイルした場合に使用可能です。

パラメータ

threshold

傾き除去の閾値。

戻り値

例1 Imagick::deskewImage()

<?php
function deskewImage($threshold) {
$imagick = new \Imagick(realpath("images/NYTimes-Page1-11-11-1918.jpg"));
$deskewImagick = clone $imagick;

//This is the only thing required for deskewing.
$deskewImagick->deskewImage($threshold);

//The rest of this example is to make the result obvious - because
To Top