Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php ImageMagick等效于框阴影CSS属性_Php_Css_Imagemagick - Fatal编程技术网

Php ImageMagick等效于框阴影CSS属性

Php ImageMagick等效于框阴影CSS属性,php,css,imagemagick,Php,Css,Imagemagick,我想模仿ImageMagick中的box shadow CSS属性。我希望它的行为完全一样。是否有任何函数或等效映射?我想您要找的是用于CLI的-shadow switch我想您要找的是用于CLI的-shadow switch <?php /* Read the image into the object */ $im = new Imagick( 'a.jpg' ); $im->setImageFormat("png"); /* Make the image a

我想模仿ImageMagick中的box shadow CSS属性。我希望它的行为完全一样。是否有任何函数或等效映射?

我想您要找的是用于CLI的-shadow switch

我想您要找的是用于CLI的-shadow switch

<?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;
?>

事实上,我想要一个下面这个答案的映射。非常感谢你的帮助框阴影:h-阴影v-阴影模糊扩散颜色嵌入;事实上,我想要一个下面这个答案的映射。非常感谢你的帮助框阴影:h-阴影v-阴影模糊扩散颜色嵌入;