开发者

How can I add a transparent OS X style border to an image using command line tools?

开发者 https://www.devze.com 2023-04-11 12:14 出处:网络
I have images and want to add a transparent gradient background to them, similar to the way OS X does with window shadows.

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:

How can I add a transparent OS X style border to an image using command line tools?

With transparent gradient:

How can I add a transparent OS X style border to an image using command line tools?

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:

How can I add a transparent OS X style border to an image using command line tools?

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:

How can I add a transparent OS X style border to an image using command line tools?

0

精彩评论

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

关注公众号