Hi,
I know I'm gonna get a lot of stick for this, but I'm really struggling trying to get a rectangle made over an image. So far I have read this page:
http://www.imagemagick.org/script/comma ... .php?#draw
From what I understand about the co-ordinate system, I need:
convert ./wintercard1.jpg -fill white -stroke black -draw "rectangle 0,0 50,600 gravity South" ./wintercard1_new3.jpg
However, that makes a vertical (600px high, 50px wide) rectangle. My rectangle needs to be at the base of the image, and 50 high + 600 wide. Can someone suggest what I'm doing wrong? Maybe I'm mis-understanding how the coordinates system works?
TIA!
Andy
Driving me up the wall trying to make a rectangle!
-
- Posts: 41
- Joined: 2009-02-12T02:05:15-07:00
Re: Driving me up the wall trying to make a rectangle!
In your code: 0,0 = rectangle top left corner 50,600 = bottom righthand corner so you are getting what you as for; try -draw "rectangle 0,0 600,50 gravity South". I do not know if gravity has any effect in the draw command.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Driving me up the wall trying to make a rectangle!
Bonzo wrote:In your code: 0,0 = rectangle top left corner 50,600 = bottom righthand corner so you are getting what you as for; try -draw "rectangle 0,0 600,50 gravity South". I do not know if gravity has any effect in the draw command.
you probably need to put -gravity south outside and before the -draw command
-
- Posts: 41
- Joined: 2009-02-12T02:05:15-07:00
Re: Driving me up the wall trying to make a rectangle!
Hi,
Thanks for the replies guys. The box is the right size now, but the damn thing is refusing to draw at the bottom of the image :/
I've also tried "South" (ie uppercase S)... and that doesn't work either
TIA
Andy
Thanks for the replies guys. The box is the right size now, but the damn thing is refusing to draw at the bottom of the image :/
Code: Select all
convert ./wintercard1.jpg -fill white -stroke black -gravity south -draw "rectangle 0,0 600,50" ./wintercard1_new3.jpg
TIA
Andy
Re: Driving me up the wall trying to make a rectangle!
I still do not know if you can use -gravity with draw as it is referancing the top left corner.
This will work:
This will work:
Code: Select all
convert ./wintercard1.jpg ( -size 598x48 xc:white -bordercolor black -border 1x1 ) -gravity south -composite wintercard1_new3.jpg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Driving me up the wall trying to make a rectangle!
I can confirm that
convert logo: -fill red -stroke black -gravity southeast -draw "rectangle 0,0 100,100" show:
does not honor -gravity.
I think -gravity is only sensitive in the following context for -draw
http://www.imagemagick.org/Usage/layers/#draw
So using -composite as Bonzo said is likely the best way.
convert logo: -fill red -stroke black -gravity southeast -draw "rectangle 0,0 100,100" show:
does not honor -gravity.
I think -gravity is only sensitive in the following context for -draw
http://www.imagemagick.org/Usage/layers/#draw
So using -composite as Bonzo said is likely the best way.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Driving me up the wall trying to make a rectangle!
gravity only effects text and image placement (and justification! - sic). It is not part of SVG so is not really used for other primitive draw commands.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/