doucang6739 2014-10-13 12:42
浏览 149
已采纳

如何在图像中使用带阴影的边缘图像?

I create an image with: Generate a stack of Polaroid-like photos from existing images using ImageMagick

convert \
img-5.jpg -thumbnail 300x200 -bordercolor white -border 10 \
-bordercolor grey60 -border 1 -bordercolor none \
-background none -rotate -4 \
\
\( img-2.jpg -thumbnail 300x200 -bordercolor white -border 10 \
   -bordercolor grey60 -border 1 -bordercolor none \
   -background none -rotate 6 \
\) \
\
\( img-3.jpg -thumbnail 300x200 -bordercolor white -border 10 \
   -bordercolor grey60 -border 1 -bordercolor none \
   -background none -rotate -2 \
\) \
\
\( img-1.jpg -thumbnail 300x200 -bordercolor white -border 10 \
   -bordercolor grey60 -border 1 -bordercolor none \
   -background none -rotate -4 \
\) \
\
\( img-4.jpg -thumbnail 300x200 -bordercolor white -border 10 \
   -bordercolor grey60 -border 1 -bordercolor none \
   -background none -rotate 4 \
\) \
\
-border 100x80 -gravity center +repage -flatten -trim +repage \
-background black \( +clone -shadow 60x4+4+4 \) +swap -background none \
-flatten stack.png

My Result: enter image description here

but i want to margin my result or padding from 4 side of background.

Is there any solution? thank you

  • 写回答

1条回答 默认 最新

  • droirqk4795 2014-10-13 19:52
    关注

    To create picture Like This :

    enter image description here

    You need to use :

    exec('convert '.$newfile1.' -thumbnail 300x200 -bordercolor white -border 10 -bordercolor grey60 -border 1 -bordercolor none -background none -rotate 3 '.$pic01.'');
    exec('convert '.$newfile1.' -thumbnail 300x200 -bordercolor white -border 10 -bordercolor grey60 -border 1 -bordercolor none -background none -rotate -4 '.$pic02.'');
    exec('convert '.$newfile1.' -thumbnail 300x200 -bordercolor white -border 10 -bordercolor grey60 -border 1 -bordercolor none -background none -rotate 5 '.$pic03.'');
    exec('convert '.$newfile1.' -thumbnail 300x200 -bordercolor white -border 10 -bordercolor grey60 -border 1 -bordercolor none -background none -rotate -9 '.$pic04.'');
    
    exec('convert -size 370x320 xc:none '.$result_image.'');
    exec("composite -gravity center ".$pic01."  ".$result_image." -quality 100 ".$result_image); 
    exec("composite -gravity center ".$pic02."  ".$result_image." -quality 100 ".$result_image);
    exec("composite -gravity center ".$pic03."  ".$result_image." -quality 100 ".$result_image); 
    exec("composite -gravity center ".$pic04."  ".$result_image." -quality 100 ".$result_image);
    
    exec("convert ".$result_image." -background  black  ( +clone -shadow 100x3+0+0 ) +swap  -background  none   -flatten ".$result_image);
    

    And your result will be like example. don't forget if you need to more image or different images repeat :

    exec('convert '.$newfile1.' -thumbnail 300x200 -bordercolor white -border 10 -bordercolor grey60 -border 1 -bordercolor none -background none -rotate 3 '.$pic01.'');
    

    and change the $newfile or change $pic01 .... $pic(n) if you need. and compose it with $result_image like:

    exec("composite -gravity center ".$pic(n)."  ".$result_image." -quality 100 ".$result_image);
    

    I hope this use full. best regard, thank you Mark

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败