How to position the -draw in imagemagick? -


i using imagemagick draw border on top of image.

this code:

convert source.jpg -stroke red -strokewidth 2 -fill transparent -draw \"roundrectangle 10,10 628,151 10,10\" source.jpg 

this works fine need able position -draw want.

i tried position border using -geometry so:

convert source.jpg -stroke red -strokewidth 2 -fill transparent -geometry  +5+15 -draw \"roundrectangle 10,10 628,151 10,10\" source.jpg 

but not position want. tried using -gravity , doesn't work either!

could please advise on this?

thanks in advance.

bonzo correct, cannot use -geometry -draw.

in imagemagick -draw can translate want center , specify +- distances corners center placement.

suppose have 100x100 size box want draw , want centered @ 250,250, then

convert input.jpg -stroke red -strokewidth 2 -fill transparent -draw "translate 250,250 roundrectangle -50,-50 50,50 10,10" output.png 

that makes easier draw same size boxes @ different locations.

see http://www.imagemagick.org/usage/draw/ http://www.imagemagick.org/script/magick-vector-graphics.php


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -