Page 1 of 1

Geometry relative to page size.

Posted: 2010-12-19T11:10:17-07:00
by weatherbadger
Hi,

I'm aiming to overlay several images on top of a base image.

My script would be something along the lines of

Code: Select all

composite -gravity southwest nameimg.gif base.gif nameoverbase.png
However, I'd like an offset from the gravity SW.

From the examples I've seen specifying geometry the offset is defined in terms of pixels. I wondered if it is possible to give the size of the base image (eg letter, or A4) and then specify the offset of the overlay in terms of inches/cms instead of pixels…

Any suggestions welcome.
Weatherbadger

Re: Geometry relative to page size.

Posted: 2010-12-19T12:40:27-07:00
by fmw42
I believe that -geometry only takes pixels and percent. Also you probably would need to look up the page size first and convert to pixels. see http://www.imagemagick.org/script/comma ... s.php#page

But one of the IM developers can answer this more definitively.

Re: Geometry relative to page size.

Posted: 2010-12-19T12:49:11-07:00
by weatherbadger
Thanks for the reply.
That link looks promising, I'll have a go at converting first.

WB

Re: Geometry relative to page size.

Posted: 2010-12-19T14:24:37-07:00
by GreenKoopa
I was wondering a similar thing last month:
Users | -crop by percent size and offsets
viewtopic.php?f=1&t=17441

Re: Geometry relative to page size.

Posted: 2010-12-19T18:31:36-07:00
by anthony
You will need to convert real world units to pixels using the current resolution (density) of the image. That is generally expressed as dpi, or Dots Per Inch.

Note however that in south west gravity positive numbers is the distance of the edge of the image from the bottom left corner.