How can I add a transparent OS X style border to an image using command line tools?
I have images and want to add a transparent gradient background to them, similar to the way OS X does with window shadows.
Is there a way I 开发者_StackOverflow社区can use something like mogrify
or sips
to add this border? The images I want to process are not screenshots, but let me show two screenshots so the effect I'm attempting is clear:
Flat image:
With transparent gradient:
This doesn't have to be exactly the same, just something similar and not a solid square border.
if you say "something similar" is also accepted. try the command below:
kent$ convert yourPNG.png \( +clone -background black -shadow 50x15+9+15 \) +swap -background none -mosaic +repage new.png
you need have Imagemagic installed.
the result looks like this:
updated
hope this time it meets your need
kent$ convert yourPng.png \( +clone -background black -shadow 55x15+0+5 \) +swap -background none -layers merge +repage new.png
result:
精彩评论