OS: MacOS
Version: ImageMagick 7.0.5-0 Q16 x86_64 2017-02-21 http://www.imagemagick.org
I have an image that is a black outline on transparent background.
https://www.dropbox.com/s/6t9r4m408ljre ... e.png?dl=0
I would like to select all black color and add a 2 pixel red border around it.
https://www.dropbox.com/s/65udncxwuqmsp ... e.png?dl=0
Add border around selection
Add border around selection
Last edited by kboehme1 on 2017-02-28T16:33:44-07:00, edited 2 times in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Add border around selection
Perhaps it would be best to upload your image to some free hosting service such as dropbox.com and put the URL here so we can fully understand your problem.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Add border around selection
try this:
Code: Select all
convert shape.png \
\( -clone -0 -background red -flatten \) \
\( -clone -0 -alpha extract -morphology dilate diamond:2 \) \
-delete 0 -alpha off -compose copy_opacity -composite \
-background black -alpha background result.png
Re: Add border around selection
That works great. Thanks!