home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 December / maximum-cd-2009-12.iso / DiscContents / gimp-2.7.0-i686-setup.exe / {app} / share / gimp / 2.0 / scripts / land.scm < prev    next >
Encoding:
Text File  |  2009-08-19  |  3.2 KB  |  90 lines

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