possible bug with -geometry -composite with IM 6.4.3-5
Posted: 2008-08-28T17:01:59-07:00
IM 6.4.3-5 Q16 Mac OSX Tiger.
The documentation for -geometry says:
"If the x is negative, the offset is measured leftward from the right edge of the screen to the right edge of the image being displayed. Similarly, negative y is measured between the bottom edges."
Perhaps I am misunderstanding this, but as I read it, if I composite a small image on a larger image with negative offsets, then the composite should be from the bottom right inward.
But neither the following seem to do that. The rose image ends up shifted up and to left of the top left corner of the white background and thus slightly cropped off.
convert \( -size 100x100 xc:white \) rose: -geometry -10-10 -composite rose_white.png
and same for
convert \( -size 100x100 xc:white \) rose: -geometry 70x46-10-10 -composite rose_white.png
Am I misunderstanding something here or is this a bug or just confusing (at least to me) documentation?
If the result is correct, is there any way to combine -gravity and -geometry to do something like:
... -gravity southeast -geometry -10-10 ...
to get the composite inward 10 pixels in each of x and y from the bottom right corner? I tried that but all I got was the rose in the bottom right corner.
AH HA! Actually using positive offsets seems to work! So this works to offset the rose inward from the bottom right.
convert \( -size 100x100 xc:white \) rose: -gravity southeast -geometry +10+10 -composite rose_white.png
The documentation for -geometry says:
"If the x is negative, the offset is measured leftward from the right edge of the screen to the right edge of the image being displayed. Similarly, negative y is measured between the bottom edges."
Perhaps I am misunderstanding this, but as I read it, if I composite a small image on a larger image with negative offsets, then the composite should be from the bottom right inward.
But neither the following seem to do that. The rose image ends up shifted up and to left of the top left corner of the white background and thus slightly cropped off.
convert \( -size 100x100 xc:white \) rose: -geometry -10-10 -composite rose_white.png
and same for
convert \( -size 100x100 xc:white \) rose: -geometry 70x46-10-10 -composite rose_white.png
Am I misunderstanding something here or is this a bug or just confusing (at least to me) documentation?
If the result is correct, is there any way to combine -gravity and -geometry to do something like:
... -gravity southeast -geometry -10-10 ...
to get the composite inward 10 pixels in each of x and y from the bottom right corner? I tried that but all I got was the rose in the bottom right corner.
AH HA! Actually using positive offsets seems to work! So this works to offset the rose inward from the bottom right.
convert \( -size 100x100 xc:white \) rose: -gravity southeast -geometry +10+10 -composite rose_white.png