问题
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