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

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -