Page 1 of 1

PAID: Script to combine images into one with coordinates

Posted: 2016-08-16T02:22:38-07:00
by tristanbacon
I originally posted this on the GIMP forums, but was directed to post a request here on the ImageMagick forums.

The problem

I have a set of 40 PNG map images covering a 400sqkm area, which need to be combined across 4 larges images for use as overlays in Google Earth. Each 'large image' contains 10 'map image'.

My current process

At the moment, I have an GIMP .xcf template with 'guides' for the large images, which allows me to essentially drag and drop each map image into GIMP, and they snap into place.

Each map image has a bit of overlap with neighboring map images, so this isn't as simple as just stitching them together, unfortunately!

Desired Outcome

Doing this manually for every 400sqkm area is currently taking me far too much time, and I'd like to either write (or pay someone to write) me a script that allows me to drag the map images into the template, run said script, and based on the name of the file, each layer is moved to the appropriate X/Y coordinates.

As an example, in a large image, one row will have 3 images: BB10-A1.png, BB10-A2.png, BB10-A3.png. In the template, A1 sits at 0,0, A2 sits at 1360,0, A3 sits at 2613,0, and so on. So, the script would know that any layer ending in -A1.png would go to 0,0, -A2.png to 1360,0 and so on.

Clearly, am willing to pay for this. Let me know if this is possible, and any quotes that you might have.

Re: PAID: Script to combine images into one with coordinates

Posted: 2016-08-16T02:38:28-07:00
by snibgo
The ImageMagick part of this would be simple. Something like:

Code: Select all

convert
  ( BB10-A1.png -repage +0+0 )
  ( BB10-A2.png -repage +1360+0 )
  ( BB10-A3.png -repage +2613+0 )
  -layers merge
  out.png
The command could be built by a script that would read a text file of the suffixes and their coordinates.

As the complex part would be the script, you should say what script language you would want.

Re: PAID: Script to combine images into one with coordinates

Posted: 2016-08-16T02:56:13-07:00
by tristanbacon
snibgo wrote:The ImageMagick part of this would be simple. Something like:

Code: Select all

convert
  ( BB10-A1.png -repage +0+0 )
  ( BB10-A2.png -repage +1360+0 )
  ( BB10-A3.png -repage +2613+0 )
  -layers merge
  out.png
The command could be built by a script that would read a text file of the suffixes and their coordinates.

As the complex part would be the script, you should say what script language you would want.
Thanks for the pointer. I'm not much of a programmer myself, but have a basic familiarity (or rather, I'm in the process of learning) Python, therefore it would be great if the script was in that language. I've already made a Python script that dumps a list of all the image files in a folder to a .txt, so I can use that .txt as the foundation of the stitching script.

Is this something you'd be able to help me with @snibgo?

Re: PAID: Script to combine images into one with coordinates

Posted: 2016-08-16T02:58:54-07:00
by snibgo
Not in Python, sorry.

Re: PAID: Script to combine images into one with coordinates

Posted: 2016-08-16T09:05:56-07:00
by fmw42
If python has a function to execute command such as PHP exec(), then you could call the Imagemagick command from that Python function. I do not know Python either.