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 21 9,098 Jul 26, 2014 14:26
Last Post: Captain_Cereal_Hands
  script to extract and overlay timestamp from jps images Mark Pigott 6 244 Jun 18, 2014 09:46
Last Post: rich2005
  Images won't export as indexed maximum411 8 267 May 29, 2014 04:10
Last Post: maximum411
Question Image Map Tool: No Image Displaying Softly 1 193 Apr 11, 2014 07:06
Last Post: ofnuts
  layer 2 images 1 transparent to another emsteel123 4 389 Apr 1, 2014 00:14
Last Post: emsteel123

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('1444')