-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFU_effects_fog.scm
104 lines (96 loc) · 3.55 KB
/
FU_effects_fog.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
; FU_effects_fog.scm
; version 2.8 [gimphelp.org]
; last modified/tested by Paul Sherman
; 02/14/2014 on GIMP-2.8.10
; 03/09/2020 on GIMP-2.10.20
; 30/11/2020 on GIMP-2.10.36
;
; 02/14/2014 - convert to RGB if needed, option to merge layers
;==============================================================
;
; Installation:
; This script should be placed in the user or system-wide script folder.
;
; Windows Vista/7/8)
; C:\Program Files\GIMP 2\share\gimp\2.0\scripts
; or
; C:\Users\YOUR-NAME\.gimp-2.8\scripts
;
; Windows XP
; C:\Program Files\GIMP 2\share\gimp\2.0\scripts
; or
; C:\Documents and Settings\yourname\.gimp-2.8\scripts
;
; Linux
; /home/yourname/.gimp-2.8/scripts
; or
; Linux system-wide
; /usr/share/gimp/2.0/scripts
;
;==============================================================
;
; LICENSE
;
; 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 3 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.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
;==============================================================
; Original information
;
; fog script-fu,
; original by ~kward1979uk (on Deviantart, see url below:)
; http://kward1979uk.deviantart.com/art/fog-script-fu-42504446?q=boost%3Apopular%20in%3Aresources%2Fapplications%2Fgimpactions&qo=72
;
;==============================================================
(define (FU-fog
inImage
inLayer
color
turb
opac
inMerge
)
(gimp-image-undo-group-start inImage)
(if (not (= RGB (car (gimp-image-base-type inImage))))
(gimp-image-convert-rgb inImage)
)
(define flat (car (gimp-image-flatten inImage)))
(gimp-context-set-background color)
(define width (car (gimp-drawable-width flat)))
(define height (car (gimp-drawable-height flat)))
(define white-layer (car (gimp-layer-new inImage width height 1 "white" opac 0)))
(gimp-drawable-fill white-layer 1)
(gimp-image-insert-layer inImage white-layer 0 -1)
(define mask (car (gimp-layer-create-mask white-layer 0)))
(gimp-layer-add-mask white-layer mask)
(plug-in-plasma 1 inImage mask (rand 4294967) turb)
(if (= inMerge TRUE)(gimp-image-merge-visible-layers inImage EXPAND-AS-NECESSARY))
(gimp-image-undo-group-end inImage)
(gimp-displays-flush)
(gc) ; garbage collect; memory cleanup
); end DEFINE
(script-fu-register "FU-fog"
"<Image>/Script-Fu/Effects/Fog"
"Applies a fog of chosen colour over image. \nfile:FU_effects_fog.scm"
"Karl Ward"
"Karl Ward"
"Nov 2006"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-COLOR "Fog Colour" '(255 255 255)
SF-ADJUSTMENT "Turbulance" '(1.0 0 6.9 0.1 1 1 0)
SF-ADJUSTMENT "Opacity" '(100 0 100 1 5 1 0)
SF-TOGGLE "Merge layers when complete?" FALSE
)
; end of script