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
  How do I add metadata to my images? GreyScale 5 128 Aug 28, 2015 05:33
Last Post: GreyScale
  Editing 2 images at the same time ShieldsA 8 251 Jul 27, 2015 16:11
Last Post: rich2005
  Gimp 2.8.14 - Scaling layers/images - image 'disappears' steveTu 7 270 Jul 24, 2015 08:27
Last Post: steveTu
  Experienced gimp users - how can I alter images on the web to make them look unique? Kuurt 10 355 Jul 8, 2015 08:15
Last Post: ofnuts
  still having difficulty blending edges of images Kait_Em 7 241 Jun 24, 2015 08:19
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS