PDA

View Full Version : Contour Lines/Maps in GIMP



Zach
01-23-2014, 05:05 PM
This isn't strictly a tutorial per se, but I can find no better place to put this up. I created a GIMP Script-Fu plugin that will take any heightfield and generate a contour map of it. Somebody requested that I post it, so here it is.

There are two scripts: Contour Line, which adds one contour line to the heightfield, and Contour Map, which adds a lot of contour lines at once by calling Contour Line.

To install the scripts in GIMP, put both .scm files in any of the folders GIMP looks in for scripts (to find this out, go to GIMP Preferences→Folders→Scripts). Then refresh the scripts by going to Filters→Script-Fu→Refresh Scripts, or just by restarting GIMP.

The script expects a simple image in shades of grey, which represents a height field (see the first example image). Contour Map allows you to set the upper and lower bounds of height (to do the whole thing use 0 and 255 respectively), set the width of the contour lines, set how much elevation is skipped between lines, and set how much smoothing the lines will receive. The example maps are only 512 x 512, so there are a lot of little artifacts that would disappear on larger maps.

Jacktannery
01-23-2014, 05:51 PM
That's brilliant - well done Zach.