Paranthesis + geometry?
Posted: 2017-10-22T11:46:55-07:00
I'm trying to center a character (as an image) in a box so that I then can easily reposition it in another image with one command.
So I have started by making sure a character is central in a image by doing the following (create image, enter text, crop to character, extend canvas) :
Now I can easily position this box on another image like this :
This seems to place the b-image with the geometry coords from a corner of the image.
However I would like to do this without creating a temporary file for the character so doing it all in one command so I am trying to use paranthesis.
However in this command it seems like the b-image is positoned by the geometry coords from the center of the background image? How can I avoid this and get the same result as with the previous command?
So I have started by making sure a character is central in a image by doing the following (create image, enter text, crop to character, extend canvas) :
Code: Select all
convert -size 200x200 xc:none -fill blue -font Courier-bold -pointsize 100 -gravity center -background none -annotate +0+0 b -trim -gravity center -extent 400x400 +repage b.png
Code: Select all
convert background.png b.png -geometry +200+400 -composite a_o.png
However I would like to do this without creating a temporary file for the character so doing it all in one command so I am trying to use paranthesis.
Code: Select all
convert background.png \( -size 200x200 xc:none -fill blue -font Courier-bold -pointsize 100 -gravity center -background none -annotate +0+0 b -trim -gravity center -extent 400x400 +repage \) -geometry +200+400 -composite out.png