home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 February / PCWorld_2001-02_cd.bin / Software / Topware / gimp / gimp-setup-20001226.exe / Main / land.scm < prev    next >
Encoding:
Text File  |  2000-12-27  |  3.1 KB  |  84 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; Land --- create a pattern that resembles a Topographic map
  4. ; Copyright (C) 1997 Adrian Karstan Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ;      This script works on the current gradient you have loaded. 
  8. ;      Some suggested gradients: 
  9. ;            Land                  (produces a earthlike map)
  10. ;            Brushed_aluminum      (looks like the moon)
  11. ;  
  12. ;
  13. ; Thanks to Quartic for helping me debug this thing. 
  14. ;
  15. ; This program is free software; you can redistribute it and/or modify
  16. ; it under the terms of the GNU General Public License as published by
  17. ; the Free Software Foundation; either version 2 of the License, or
  18. ; (at your option) any later version.
  19. ; This program is distributed in the hope that it will be useful,
  20. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. ; GNU General Public License for more details.
  23. ; You should have received a copy of the GNU General Public License
  24. ; along with this program; if not, write to the Free Software
  25. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26.  
  27.  
  28.  
  29. (define (script-fu-land width height seed detail landheight seadepth xscale yscale gradient)
  30.   (let* (
  31.      (img (car (gimp-image-new width height RGB)))
  32.      (layer-one (car (gimp-layer-new img width height RGB "bottom" 100 NORMAL)))
  33.     )
  34.   (gimp-gradients-set-active gradient)
  35.   (gimp-image-undo-disable img)
  36.   (gimp-image-add-layer img layer-one 0)
  37.  
  38.   (plug-in-solid-noise 1 img layer-one TRUE FALSE seed detail xscale yscale)
  39.   (plug-in-c-astretch 1 img layer-one)
  40.   (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
  41.   (gimp-image-add-layer img layer-two -1)
  42.   (gimp-image-set-active-layer img layer-two)
  43.  
  44.   (plug-in-gradmap 1 img layer-two)
  45.  
  46.  
  47.  
  48.   (gimp-by-color-select layer-one '(190 190 190) 55 REPLACE FALSE FALSE 0 FALSE)
  49.   (plug-in-bump-map 1 img layer-two layer-one 135.0 35 landheight 0 0 0 0 TRUE FALSE 0)
  50.  
  51.   ;(plug-in-c-astretch 1 img layer-two)
  52.   (gimp-selection-invert img)
  53.   (plug-in-bump-map 1 img layer-two layer-one 135.0 35 seadepth 0 0 0 0 TRUE FALSE 0)
  54.  
  55.   ;(plug-in-c-astretch 1 img layer-two)
  56.  
  57.   ; uncomment the next line if you want to keep a selection of the "land"
  58.   (gimp-selection-none img)
  59.  
  60.   (gimp-display-new img)
  61.   (gimp-image-undo-enable img)
  62. ))
  63.  
  64. (script-fu-register "script-fu-land"
  65.             _"<Toolbox>/Xtns/Script-Fu/Patterns/Land..."
  66.             "A Topgraphic map pattern"
  67.             "Adrian Likins <aklikins@eos.ncsu.edu>"
  68.             "Adrian Likins"
  69.             "1997"
  70.             ""
  71.             SF-ADJUSTMENT _"Image Width" '(256 10 1000 1 10 0 1)
  72.             SF-ADJUSTMENT _"Image Height" '(256 10 1000 1 10 0 1)
  73.             SF-ADJUSTMENT _"Random Seed" '(32 0 15000000 1 10 0 1)
  74.             SF-ADJUSTMENT _"Detail Level" '(4 1 15 1 5 0 0)
  75.             SF-ADJUSTMENT _"Land Height" '(60 1 65 1 10 0 1)
  76.             SF-ADJUSTMENT _"Land Height" '(4 1 65 1 10 0 1)
  77.             SF-ADJUSTMENT _"Scale X" '(4 0.1 16 1 5 0.1 0)
  78.             SF-ADJUSTMENT _"Scale Y" '(4 0.1 16 1 5 0.1 0)
  79.             SF-GRADIENT   _"Gradient" "Land_1")
  80.