Does "-geometry" round non-integer args?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
HiRezGuy
Posts: 19
Joined: 2018-06-24T08:26:07-07:00
Authentication code: 1152

Does "-geometry" round non-integer args?

Post by HiRezGuy »

I've been using the following command line with the -geometry option. It works as expected, and no errors or warnings are thrown.

Code: Select all

"C:\Program Files\ImageMagick\composite" -gravity NorthEast -geometry +95+95.6 image_1b.png image_0b.png image_6-01.png
QUESTION:
What does IM do with the decimal portion of the argument that I'm passing with -geometry (e.g., round-up, round-down, truncate)? It's too difficult to tell by visually inspecting the resultant png.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Does "-geometry" round non-integer args?

Post by fmw42 »

Looks like it rounds. I create a 2x1 black image, the a 1x1 white image and use -geometry +0.7+0. If it truncated the white would be on the left, but the white is on the right. That tells me it rounds.

Code: Select all

convert -size 2x1 xc:black -size 1x1 xc:white -geometry +0.7+0 -compose over -composite -scale 20x10! result.gif
Post Reply