Geometry relative to page size.

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
weatherbadger
Posts: 15
Joined: 2010-03-01T09:52:50-07:00
Authentication code: 8675308
Location: Oxford UK

Geometry relative to page size.

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Geometry relative to page size.

Post 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.
weatherbadger
Posts: 15
Joined: 2010-03-01T09:52:50-07:00
Authentication code: 8675308
Location: Oxford UK

Re: Geometry relative to page size.

Post by weatherbadger »

Thanks for the reply.
That link looks promising, I'll have a go at converting first.

WB
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Geometry relative to page size.

Post by GreenKoopa »

I was wondering a similar thing last month:
Users | -crop by percent size and offsets
viewtopic.php?f=1&t=17441
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Geometry relative to page size.

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply