开发者

Create drop shadow effects in Imagemagick

开发者 https://www.devze.com 2023-03-12 19:56 出处:网络
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?

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 w开发者_运维问答hich I found quite accidentlly is posted below as an answer.


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

Create drop shadow effects in Imagemagick

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


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

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


Shutter uses the following command https://github.com/shutter-project/shutter/blob/master/share/shutter/resources/system/plugins/perl/spshadow/spshadow#L375

convert in.png -gravity 'northwest' -background 'rgba(255,255,255,0)' -splice '10x10' \( +clone -background '#005f005f005f0000' -shadow "80x3-1-1" \) +swap -background none -mosaic +repage \( +clone -background '#005f005f005f0000' -shadow "80x3+5+5" \) +swap -background none -mosaic +repage out.png
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号