PHP 8.3.4 Released!

Imagick::embossImage

(PECL imagick 2, PECL imagick 3)

Imagick::embossImageÜç boyutluluk etkisi vermek için görüntüyü gri tonlamaya dönüştürür

Açıklama

public Imagick::embossImage(float $yarıçap, float $sapma): bool

Üç boyutluluk etkisi vermek için görüntüyü gri tonlamaya dönüştürür. Yarıçap ve standart sapması belirtilen bir Gauss işleci ile resim evriştirilir. Makul sonuçlar elde etmek için yarıçap standart sapmadan büyük olmalıdır. yarıçap olarak 0 verirseniz Imagick::embossImage() size uygun bir yarıçap seçecektir.

Bağımsız Değişkenler

yarıçap

Etkinin uygulanacağı yarıçap.

sapma

Piksel cinsinden standart sapma.

Dönen Değerler

Başarı durumunda true döner.

Hatalar/İstisnalar

Hata durumunda bir ImagickException istisnası oluşur.

Örnekler

Örnek 1 - Imagick::embossImage() kullanımı

<?php
function embossImage($imagePath, $radius, $sigma) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->embossImage($radius, $sigma);
header("Content-Type: image/jpg");
echo
$imagick->getImageBlob();
}

?>

add a note

User Contributed Notes 1 note

up
0
DJ Mike
12 years ago
embossImage() will actually return a color image with a 3D effect. If you want a gray scale image, you can use imagefilter() from the regular GD functions.

<?php
header
("Content-type: image/jpeg");
$image = new Imagick("opossum.jpg");
$image->embossImage( 0, 1 );
echo
$image;
?>
To Top