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]

Find all posts by this user
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Experienced gimp users - how can I alter images on the web to make them look unique? Kuurt 5 66 Today 17:36
Last Post: rich2005
  still having difficulty blending edges of images Kait_Em 7 122 Jun 24, 2015 08:19
Last Post: paynekj
  How to crash GIMP in 3 easy step... Galenmacil 5 124 May 25, 2015 23:22
Last Post: fluffybunny2
  [2.8.14/Xubuntu 15.04] How to open new images maximized with "Fit Image in Window" marcelpaulo 4 232 May 12, 2015 09:53
Last Post: marcelpaulo
  custom chopping of images xunil76 3 163 Apr 28, 2015 19:15
Last Post: rich2005

Forum Jump:

GIMP ForumPortalArchiveContactTermsRSS