Post Reply 

Easy way to break up political map into individual images?

Sep 18, 2011, 01:55
Post: #1
Easy way to break up political map into individual images?
I have an image of political boundary map that I want to break up so that I have an individual image for each unit, such that I could combine them back together and get the original map. For purpose of illustration, let's say it's a US state map.

I know that I could take the original image, erase everything but Washington State to alpha, save that as Washington, then undo back to the beginning, erase everything but Oregon to alpha, save that as Oregon, undo, etc, until I had all 50 states, all in the same position as on the original map. I could then easily create images of arbitrary groups of states by just combining the images of the individual states I wanted to be in the group.

But getting to that point would take 50 manual erasings for a state map, and many more on my actual map. Is there a way to break up the map in an automated way?

The map image has the boundary all in one color that isn't otherwise present in the image, so it's easy enough to select just the boundary, but I'm stumped what to do from there other than the manual process I outlined above.

Any help would be appreciated. I'm using Gimp 2.6.8 in Ubuntu, if that matters.
Find all posts by this user
Quote this message in a reply
Sep 18, 2011, 08:39
Post: #2
RE: Easy way to break up political map into individual images?
A possible method:
  • Extract the borders, the idea bing to obtain a layer with only the borders and everything else transparent.
  • Move that layer above your image
  • Make it the current layer
  • If you use the magic wand and click in a state, it will make a selection over the whole state
  • Make the full map the current layer and copy/paste to a State image (you may want to grow the selection by one or two pixels to include the border). This can also be scripted as:
    • duplicate full map layer
    • Grow selection 2px (includes border)
    • invert selection
    • delete selection
    • autocrop layer
    • save layer
    • delete layer
Further scripting is possible, for instance using a side file that will contain "state" names and some point inside the state to initiate the magic wand selection.

[Image: 2Tvo0.png]

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Exporting Multiple Layers Into Images (PNG, JPG, etc) SavingMultipleImages 25 10,434 Oct 6, 2014 10:59
Last Post: rich2005
  Person break through an object goad 2 190 Aug 26, 2014 21:59
Last Post: goad
  Imagemagick is not compressing images like GIMP rublacava 1 233 Aug 23, 2014 08:23
Last Post: rich2005
Exclamation Map to object crashed HELP!!!! Elite Warrior 14 374 Aug 21, 2014 19:02
Last Post: Elite Warrior
  script to extract and overlay timestamp from jps images Mark Pigott 6 480 Jun 18, 2014 09:46
Last Post: rich2005

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS