Create drop shadow effects in Imagemagick

拟墨画扇 提交于 2020-01-13 10:13:26

问题


The border shadow effects used in the images of this blog post seem to be embeded in the images themselves (not css3). How can it be created in imagemagick?

Edit 1: The solution which I found quite accidentlly is posted below as an answer.


回答1:


There is a -shadow argument on convert that has options to do this.

http://blog.bemoko.com/2009/07/01/add-shadow-and-border-to-images-with-imagemagick/




回答2:


Somehow I found the command which does what I wanted exactly:

For images which are already scaled and compressed:

 convert input.jpeg -bordercolor white -border 13 \( +clone -background black -shadow 80x3+2+2 \) +swap -background white -layers merge +repage output.jpg

For creating thumbnails:

 convert input.jpeg -thumbnail 200x200 -bordercolor white -border 6 \( +clone -background black -shadow 80x3+2+2 \) +swap -background white -layers merge +repage  output.jpg

For raw images:

convert input.jpeg -scale 600x400 -quality 86 -strip -bordercolor white -border 13 \( +clone -background black -shadow 80x3+2+2 \) +swap -background white -layers merge +repage output.jpg


来源:https://stackoverflow.com/questions/6351828/create-drop-shadow-effects-in-imagemagick

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!