GIMP Script-fu

Changes On Branch sg-3d-ify
Login

Changes On Branch sg-3d-ify

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch sg-3d-ify Excluding Merge-Ins

This is equivalent to a diff from cf23bd898b to eebd3eb06b

2015-05-22
21:34
Create new branch named "sg-layer-bake" check-in: c4e75ba86e user: saul tags: sg-layer-bake
2015-03-27
01:38
Create new branch named "sg-group-linked-layers" check-in: a8849c0376 user: saul tags: sg-group-linked-layers
2015-03-25
17:33
Create new branch named "sg-decompose-text-layer" check-in: a1515524c2 user: saul tags: sg-decompose-text-layer
2015-03-17
18:49
Create new branch named "sg-render-palette-preview" check-in: 4f1cbefb4c user: saul tags: sg-render-palette-preview
2015-02-25
08:28
Create new branch named "schemey-fu" check-in: 5bbe976611 user: saul tags: schemey-fu
2015-02-24
07:14
Create new branch named "sg-schemy-fu" check-in: 07ab821547 user: saul tags: sg-schemy-fu
2015-02-08
14:29
Create new branch named "sg-ungroup-layer" check-in: 5efa4c1218 user: saul tags: sg-ungroup-layer
12:53
Create new branch named "sg-splice-grouped-layer" Closed-Leaf check-in: 5e982d637f user: saul
12:35
Create new branch named "sg-splice-group" Closed-Leaf check-in: 1c8774511c user: saul
2015-02-04
08:25
Create new branch named "sg-add-group-mask" check-in: 0d5aa5c54f user: saul tags: sg-add-group-mask
2015-01-24
20:37
Create new branch named "sg-text-sphere" check-in: 836e1da14d user: saul tags: sg-text-sphere
2014-12-19
23:46
Create new branch named "sg-dump-path-colors" check-in: c5f6d76f4c user: saul tags: sg-dump-path-colors
2014-12-06
17:40
Create new branch named "sg-float-layer" check-in: 9e12bc0967 user: saul tags: sg-float-layer
2014-11-08
23:30
Create new branch named "sg-save-all-layers-to-directory" check-in: f711177647 user: saul tags: sg-save-all-layers-to-directory
23:28
Create new branch named "sg-save-all-layers-to-directory.scm" Leaf check-in: 1745a103d0 user: saul tags: sg-save-all-layers-to-directory.scm
2014-11-04
05:56
Create new branch named "sg-save-pdf-multi" check-in: f1259633d4 user: saul tags: sg-save-pdf-multi
2014-10-19
18:33
Create new branch named "sg-split-strokes" check-in: db1b5362c8 user: saul tags: sg-split-strokes
2014-10-14
10:06
Create new branch named "srfi26-cute-cut" check-in: e6d98719ae user: saul tags: srfi26-cute-cut
2014-10-05
02:21
Create new branch named "sg-fvful" check-in: d8b478ea27 user: saul tags: sg-fvful
2014-09-13
08:36
Create new branch named "sg-merge-retain-rgb" check-in: e37665ce07 user: saul tags: sg-merge-retain-rgb
2014-07-13
11:16
Create new branch named "sg-grid-layer" check-in: 9c302f4f80 user: saul tags: sg-grid-layer
2014-06-04
14:51
Create new branch named "sg-de-mirror" check-in: 506e951f8f user: saul tags: sg-de-mirror
2014-04-04
23:24
Create new branch named "sg-STW-brochures" check-in: 1339ddf45c user: saul tags: sg-STW-brochures
2014-03-23
18:37
Create new branch named "sg-process-tga-files" check-in: aa1fa9108d user: saul tags: sg-process-tga-files
2014-03-22
00:16
Create new branch named "sg-with-files" check-in: d7e5d36797 user: saul tags: sg-with-files
2014-03-17
12:12
Create new branch named "sg-sequential-edit" check-in: 68950ba1e6 user: saul tags: sg-sequential-edit
2014-03-04
22:49
Create new branch named "sg-save-all-projections" check-in: 3750033250 user: saul tags: sg-save-all-projections
2014-03-01
17:28
Create new branch named "sg-stash-guides" check-in: 3135a9f5a4 user: saul tags: sg-stash-guides
2014-02-03
18:57
Create new branch named "fu-lib" check-in: 6703e22f7b user: saul tags: fu-lib
18:57
Ignore this branch named "fu-lib.scm" Closed-Leaf check-in: 38aac1784f user: saul
2014-01-09
01:36
Create new branch named "sg-alpha-to-svg-file" check-in: 68637c0508 user: saul tags: sg-alpha-to-svg-file
2014-01-02
19:10
Create new branch named "sg-process-layers" check-in: 23b79b0996 user: saul tags: sg-process-layers
2013-12-14
18:20
Create new branch named "fireanim" check-in: 165d30ddd5 user: saul tags: fireanim
2013-12-02
17:16
Create new branch named "sg-save-path-as-poly.scm" check-in: ac5ab91cc5 user: saul tags: sg-save-path-as-poly.scm
2013-11-24
16:12
Script to perform pseudo-extrusions. Leaf check-in: eebd3eb06b user: saul tags: sg-3d-ify
16:12
Create new branch named "sg-3d-ify" check-in: 4a079c03bc user: saul tags: sg-3d-ify
2013-11-13
07:06
Create new branch named "sg-luminosity-masks" check-in: 1df9a40cf0 user: saul tags: sg-luminosity-masks
2013-09-17
16:43
Create new branch named "sg-kumar-kovuru" check-in: e5d1d3f8b3 user: saul tags: sg-kumar-kovuru
2013-07-16
04:21
Create new branch named "sg-pseudo-depth-map" check-in: fd9ac68f7e user: saul tags: sg-pseudo-depth-map
2013-07-06
23:12
Create new branch named "sg-dissolve-group" check-in: ed925e7d9c user: saul tags: sg-dissolve-group
2013-07-04
01:32
Create new branch named "sg-shadow-all-layers" check-in: 4a0fed20b2 user: saul tags: sg-shadow-all-layers
2013-06-24
17:06
Create new branch named "sg-copyright-symbol" check-in: 245b0ed848 user: saul tags: sg-copyright-symbol
2013-06-22
23:52
Create new branch named "sg-tone-map" check-in: 4a1b7f0f16 user: saul tags: sg-tone-map
2013-06-20
04:30
Create new branch named "sg-arrow-stroke-path" check-in: bbd0c9ad2b user: saul tags: sg-arrow-stroke-path
2013-06-06
12:04
Create new branch named "sg-snakes-and-ladders" check-in: 9b7689dfcd user: saul tags: sg-snakes-and-ladders
2013-05-23
16:58
Create new branch named "sg-merge-divide" check-in: 22b7b71c02 user: saul tags: sg-merge-divide
2013-05-17
08:55
Create new branch named "sg-borders" check-in: d9a8e61268 user: saul tags: sg-borders
2013-04-14
03:27
Create new branch named "sg-decomp-to-layers" Leaf check-in: 2b68df9d38 user: saul tags: sg-decomp-to-layers
2013-04-05
01:36
Create new branch named "sg-viktoria" check-in: 7c55465e6b user: saul tags: sg-viktoria
2013-02-26
03:24
Create new branch named "sg-hypmotized" check-in: 1d9e876332 user: saul tags: sg-hypmotized
2013-02-15
04:34
Create new branch named "sg-mtg-slate" check-in: 79331851cc user: saul tags: sg-mtg-slate
2013-01-06
04:07
Create new branch named "sg-save-histogram-info" Leaf check-in: 1db7b4bee5 user: saul tags: sg-save-histogram-info
2012-11-27
05:01
Create new branch named "sg-export-image-tree" check-in: d4928d0303 user: saul tags: sg-export-image-tree
2012-10-28
22:39
Create new branch named "sg-activity-log" Leaf check-in: 73552bb511 user: saul tags: sg-activity-log
22:30
Create new branch named "sg-logging" Leaf check-in: 996eb4f812 user: saul tags: sg-logging
2012-10-21
15:23
Create new branch named "sg-2d-packing" check-in: 4a7b7372f3 user: saul tags: sg-2d-packing
2012-10-14
12:14
Create new branch named "sg-hootyhoo" check-in: 080c78cad9 user: saul tags: sg-hootyhoo
2012-09-19
17:29
Create new branch named "sg-mgwalk-save" check-in: fbca1a5253 user: saul tags: sg-mgwalk-save
2012-09-12
22:25
Create new branch named "sg-photocomics" check-in: 8bc833a7f3 user: saul tags: sg-photocomics
2012-09-06
02:58
Create new branch named "sg-decompose" check-in: 5d6d26b662 user: saul tags: sg-decompose
2012-09-04
09:25
Create new branch named "sg-copy-mask" check-in: 6c15fb4db8 user: saul tags: sg-copy-mask
2012-09-03
17:40
Create new branch named "sg-apply-masks" check-in: 0066ab04c7 user: saul tags: sg-apply-masks
2012-08-22
11:15
Create new branch named "sg-multifill" check-in: e653d29bec user: saul tags: sg-multifill
2012-08-12
05:25
Create new branch named "sg-save-all-layers" check-in: cb9f750763 user: saul tags: sg-save-all-layers
2012-06-13
05:28
Create new branch named "sg-goobie" check-in: ff12df0c63 user: saul tags: sg-goobie
05:24
Create new branch named "sg-create-badges" check-in: b2cbf306cc user: saul tags: sg-create-badges
2012-05-29
05:27
Create new branch named "sg-process-jpegs-in-folder" check-in: 876d582ad4 user: saul tags: sg-process-jpegs-in-folder
2012-05-21
23:01
Create new branch named "sg-dejw-paste" check-in: 8ea62d1137 user: saul tags: sg-dejw-paste
2012-04-15
16:04
Create new branch named "sg-numbered-frames.scm" check-in: 797f07925b user: saul tags: sg-numbered-frames.scm
2012-04-07
07:17
Create new branch named "sg-select-within-layer" check-in: 5ac83fffdf user: saul tags: sg-select-within-layer
2012-03-27
10:57
Create new branch named "sg-anim-settings" check-in: f244e32dc9 user: saul tags: sg-anim-settings
2012-02-28
02:31
Create new branch named "sg-copy-mask-from-above" check-in: c9985a274d user: saul tags: sg-copy-mask-from-above
2012-02-15
17:44
Create new branch named "sg-contour-fill" check-in: 008532b72c user: saul tags: sg-contour-fill
2012-02-06
20:45
Create new branch named "sg-zibbafy" check-in: f7ca57d139 user: saul tags: sg-zibbafy
2012-01-13
13:39
Create new branch named "sg-select-similar-colors" check-in: 37b920c537 user: saul tags: sg-select-similar-colors
2011-11-27
17:48
Create new branch named "sg-ornament-simple" check-in: a742ec8e81 user: saul tags: sg-ornament-simple
2011-11-06
13:32
Create new branch named "sg-channel-blend" check-in: c1ac254420 user: saul tags: sg-channel-blend
2011-10-16
04:28
Create new branch named "sg-expand-strip" check-in: 1f353fce5c user: saul tags: sg-expand-strip
2011-10-12
01:20
Create new branch named "sg-candlelit" check-in: 347f3d34ed user: saul tags: sg-candlelit
2011-09-27
09:23
Create new branch named "sg-tooninator" check-in: a6ce201c97 user: saul tags: sg-tooninator
2011-08-09
20:19
Create new branch named "sg-snapshot" check-in: 090f94d913 user: saul tags: sg-snapshot
2011-07-17
05:17
Create new branch named "sg-mystic-rose" check-in: 64f406315f user: saul tags: sg-mystic-rose
2011-07-12
05:01
Create new branch named "sg-panzoom" check-in: 285b349c70 user: saul tags: sg-panzoom
2011-07-11
18:12
Create new branch named "sg-incandescence". Leaf check-in: 11196fd42b user: saul tags: sg-incandescence
2011-05-10
20:28
Create new branch named "sg-quantize" check-in: 464add1ba1 user: saul tags: sg-quantize
2011-04-26
17:44
Create new branch named "sg-pattern-border" check-in: ead511acd2 user: saul tags: sg-pattern-border
2011-04-22
08:01
Create new branch named "sg-technicolor-3" check-in: a2013fa115 user: saul tags: sg-technicolor-3
2011-02-28
01:54
Create new branch named "sg-rotate-tab-labels" check-in: 1b53b0735f user: saul tags: sg-rotate-tab-labels
2011-02-25
22:34
Create new branch named "sg-mosaicize" check-in: 1a8a12053e user: saul tags: sg-mosaicize
2011-02-10
05:34
Create new branch named "sg-letter-drop" check-in: 51d381624d user: saul tags: sg-letter-drop
2011-02-01
03:07
Create new branch named "sg-projection-to-dodecahedron" check-in: 07340bd80e user: saul tags: sg-projection-to-dodecahedron
2011-01-27
20:43
Create new branch named "sg-extend-layer" check-in: 74915931aa user: saul tags: sg-extend-layer
2011-01-18
18:21
Create new branch named "sg-merge-linked" check-in: 938990b590 user: saul tags: sg-merge-linked
2011-01-09
16:49
Create new branch named "sg-dodecalendar" Closed-Leaf check-in: 69860bfec9 user: saul
2010-12-28
16:58
Create new branch named "sg-calendar-year" check-in: cc9615ab14 user: saul tags: sg-calendar-year
00:24
Create new branch named "sg-calendar" check-in: 74bb511193 user: saul tags: sg-calendar
2010-12-14
23:48
Create new branch named "sg-combine-bg" check-in: 4d56aac507 user: saul tags: sg-combine-bg
2010-12-04
14:57
Create new branch named "sg-fit-face" check-in: 366a3d12e8 user: saul tags: sg-fit-face
2010-11-14
22:16
Create new branch named "sg-colorcube" check-in: 08198c0bd5 user: saul tags: sg-colorcube
2010-11-13
15:17
Create new branch named "sg-damien" check-in: 47fd9604dd user: saul tags: sg-damien
2010-11-12
05:38
Create new branch named "sg-histogram-hue" check-in: 1be57e8b83 user: saul tags: sg-histogram-hue
2010-11-02
11:17
Create new branch named "sg-mean-fill" check-in: 0248a1f958 user: saul tags: sg-mean-fill
2010-10-25
10:39
Create new branch named "sg-layer-fit-to-selection" check-in: 08b6529ec0 user: saul tags: sg-layer-fit-to-selection
2010-10-02
14:26
Create new branch named "sg-gradient-survey" check-in: 587a076fe0 user: saul tags: sg-gradient-survey
2010-09-18
09:36
Create new branch named "sg-mirror-dup" check-in: b6ac506cba user: saul tags: sg-mirror-dup
2010-08-16
05:08
Create new branch named "sg-sudoku" check-in: 4a90bcc680 user: saul tags: sg-sudoku
2010-08-05
04:47
Create new branch named "sg-align-down" check-in: 4de83f17ac user: saul tags: sg-align-down
02:25
Create new branch named "sg-warptext" check-in: e2e125da6a user: saul tags: sg-warptext
2010-07-28
23:11
Create new branch named "sg-scale-to-selection" check-in: 3c68259dfc user: saul tags: sg-scale-to-selection
23:08
Create new branch named "sg-isolate" check-in: 9685296eac user: saul tags: sg-isolate
22:52
Create new branch named "sg-anti-crop" check-in: d8e79744c5 user: saul tags: sg-anti-crop
22:48
Added empty file. check-in: b2436f229b user: saul tags: trunk
13:29
initial empty check-in check-in: cf23bd898b user: saulgoode tags: trunk, root

Added sg-3d-ify.scm.






































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.

(define (script-fu-sg-3d-ify image drawable height direction density color)
  (gimp-image-undo-group-start image)
  (let* ((height (truncate height))
         (direction (truncate (modulo (- 180 direction) 360)))
         (density (truncate density))
         (blur-layer (car (gimp-layer-copy drawable TRUE)))
         (dup-layer 0)
         (orig-sel (car (gimp-selection-save image))))
    (gimp-context-push)
    (gimp-context-set-foreground color)
    (gimp-image-add-layer image blur-layer (car (gimp-image-get-layer-position image drawable)))
    (gimp-image-lower-layer image blur-layer)
    (gimp-layer-resize-to-image-size blur-layer)
    (if (zero? (car (gimp-selection-is-empty image)))
      (begin
        (gimp-selection-invert image)
        (gimp-edit-clear blur-layer)
        (gimp-selection-invert image)
        (gimp-edit-fill blur-layer FOREGROUND-FILL)
        (gimp-selection-none image))
      (begin
        (gimp-layer-set-lock-alpha blur-layer TRUE)
        (gimp-edit-fill blur-layer FOREGROUND-FILL)
        (gimp-layer-set-lock-alpha blur-layer FALSE)))
    (plug-in-mblur RUN-NONINTERACTIVE image blur-layer 0 height direction 0 0)
    (while (> density 0)
      (set! dup-layer (car (gimp-layer-copy blur-layer TRUE)))
      (gimp-image-add-layer image dup-layer -1)
      (set! blur-layer (car (gimp-image-merge-down image dup-layer CLIP-TO-IMAGE)))
      (set! density (- density 1)))
    (gimp-drawable-set-name blur-layer "3D shadow")
    (gimp-selection-load orig-sel)
    (gimp-image-remove-channel image orig-sel)
    (gimp-context-pop)
    )
  (gimp-image-undo-group-end image)
  (gimp-progress-end)
  (gimp-displays-flush)
  )

(script-fu-register "script-fu-sg-3d-ify"
  "3D-ify"
  "3D effect per Youssef"
  "Saul Goode"
  "saulgoode"
  "Aug 2010"
  "RGB*, GRAY*"
  SF-IMAGE    "Image"    0
  SF-DRAWABLE "Drawable" 0
  SF-ADJUSTMENT "Height" '( 15 1 200 1 10 0 1)
  SF-ADJUSTMENT "Direction" '( -45 -360 360 1 10 0 1)
  SF-ADJUSTMENT "Density (1-100)" '( 10 1 100 1 10 0 1 )
  SF-COLOR "Color" '(128 128 128)
  )
(script-fu-menu-register "script-fu-sg-3d-ify"
  "<Image>/Filters/Misc"
  )