2
我想模仿ImageMagick中的圖像陰影CSS屬性。我希望它表現得完全一樣。有沒有功能或等效的映射?ImageMagick等效於Box-shadow CSS屬性
我想模仿ImageMagick中的圖像陰影CSS屬性。我希望它表現得完全一樣。有沒有功能或等效的映射?ImageMagick等效於Box-shadow CSS屬性
<?php
/* Read the image into the object */
$im = new Imagick('a.jpg');
$im->setImageFormat("png");
/* Make the image a little smaller, maintain aspect ratio */
$im->thumbnailImage(200, null);
/* Clone the current object */
$shadow = $im->clone();
/* Set image background color to black (this is the color of the shadow) */
$shadow->setImageBackgroundColor(new ImagickPixel('black'));
/* Create the shadow */
$shadow->shadowImage(80, 3, 5, 5);
/* Imagick::shadowImage only creates the shadow. That is why the original image is composited over it */
$shadow->compositeImage($im, Imagick::COMPOSITE_OVER, 0, 0);
/* Display the image */
header("Content-Type: image/jpeg");
echo $shadow;
?>
我想你要找的是什麼Imagick::shadowImage(CLI的-shadow開關)
我其實是想下面這個答案的一個映射。非常感謝你的幫助。 :-) box-shadow:h-shadow v-shadow blur spread color inset; – 2012-07-26 06:45:59