-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFU_artist_conte.scm
307 lines (266 loc) · 11.3 KB
/
FU_artist_conte.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
; FU_artist_conte.scm
; version 2.8 [gimphelp.org]
; last modified/tested by Paul Sherman
; 02/15/2014 on GIMP-2.8.10
;
; 02/15/2014 - work with non-rgb, merge option and install info added
;==============================================================
;
; Installation:
; This script should be placed in the user or system-wide script folder.
;
; Windows 10
; C:\Program Files\GIMP 2\share\gimp\2.0\scripts
; or
; C:\Users\YOUR-NAME\.gimp-2.10\scripts
;
;
; Linux
; /home/yourname/.gimp-2.8/scripts
; or
; Linux system-wide
; /usr/share/gimp/2.0/scripts
;
;
; ALSO NEED TO COPY: - Custome Gimpressionist settings must be named as follows
; ev_strokes45ra
; graphite2
;
; Windows Vista/7
; C:\Program Files\GIMP 2\share\gimp\2.0\gimpressionist\presets
; or
; C:\Users\YOUR-NAME\.gimp-2.8\gimpressionist\presets
;
; Windows XP
; C:\Program Files\GIMP 2\share\gimp\2.0\gimpressionist\preset
; or
; C:\Documents and Settings\yourname\.gimp-2.8\gimpressionist\presets
;
; Linux
; /home/yourname/.gimp-2.8/gimpressionist/presets
; or
; Linux - system-wide
; /usr/share/gimp/2.0/gimpressionist/Presets
;==============================================================
;
; 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
;
; Conte image script for GIMP 2.2
; Copyright (C) 2007 Eddy Verlinden <[email protected]>
;==============================================================
(define (FU-conte
img
drawable
brightness
contrast
wild?
canvas?
inMerge
customGimpress
customThresh
)
(gimp-image-undo-group-start img)
(if (not (= RGB (car (gimp-image-base-type img))))
(gimp-image-convert-rgb img))
(let* (
(width (car (gimp-drawable-width drawable)))
(height (car (gimp-drawable-height drawable)))
(old-selection (car (gimp-selection-save img)))
(image-type (car (gimp-image-base-type img)))
(layer-type (car (gimp-drawable-type drawable)))
(layer-tempa (car (gimp-layer-new img width height layer-type "tempa" 100 LAYER-MODE-NORMAL)))
(layer-tempb (car (gimp-layer-new img width height layer-type "tempb" 100 LAYER-MODE-NORMAL)))
(layer-tempc (car (gimp-layer-new img width height layer-type "tempc" 100 LAYER-MODE-NORMAL)))
(layer-tempd (car (gimp-layer-new img width height layer-type "tempd" 100 LAYER-MODE-NORMAL)))
(layer-tempe (car (gimp-layer-new img width height layer-type "tempe" 100 LAYER-MODE-NORMAL)))
(img2 (car (gimp-image-new width height image-type)))
(layer-temp2 (car (gimp-layer-new img2 width height layer-type "temp2" 100 LAYER-MODE-NORMAL)))
)
(if (eqv? (car (gimp-selection-is-empty img)) TRUE)
(gimp-drawable-fill old-selection FILL-WHITE)) ; so Empty and All are the same.
(gimp-selection-none img)
;-------------------------------------------------------
(if (eqv? (car (gimp-palettes-get-list "conte_ev8")) 0)
(begin
(gimp-message "new palette conte_ev8")
(gimp-palette-new "conte_ev8")
(gimp-palette-add-entry "conte_ev8" "1" '(117 96 91))
(gimp-palette-add-entry "conte_ev8" "2" '(139 91 87))
(gimp-palette-add-entry "conte_ev8" "3" '(164 91 85))
(gimp-palette-add-entry "conte_ev8" "4" '(185 103 89))
(gimp-palette-add-entry "conte_ev8" "5" '(240 238 239))
(gimp-palette-add-entry "conte_ev8" "6" '(205 212 220))
(gimp-palette-add-entry "conte_ev8" "7" '(90 93 100))
(gimp-palette-add-entry "conte_ev8" "8" '(51 51 51))
(gimp-palette-add-entry "conte_ev8" "9" '(241 242 241))
)
)
(if (> (car (gimp-palettes-get-list "conte_ev8 ")) 0)
(gimp-message "There is/are palette(s) 'conte_ev8 *'. The best is to delete all palettes 'conte_ev8' (in the dialog 'palettes'). A new original will be created the next time this script is activated"))
(if (> (car (gimp-palettes-get-list "conte_ev8#")) 0)
(gimp-message "There is/are palette(s) 'conte_ev8#'. The best is to delete all palettes 'conte_ev8' (in the dialog 'palettes'). A new original will be created the next time this script is activated"))
;-------------------------------------------------------
(gimp-drawable-fill layer-tempa FILL-TRANSPARENT)
(gimp-image-insert-layer img layer-tempa 0 -1)
(gimp-edit-copy drawable)
(gimp-floating-sel-anchor (car (gimp-edit-paste layer-tempa 0)))
(gimp-drawable-fill layer-tempb FILL-TRANSPARENT)
(gimp-image-insert-layer img layer-tempb 0 -1)
(gimp-edit-copy drawable)
(gimp-floating-sel-anchor (car (gimp-edit-paste layer-tempb 0)))
(plug-in-neon 1 img layer-tempa 5.0 0)
(gimp-drawable-invert layer-tempa FALSE)
(gimp-drawable-desaturate layer-tempa DESATURATE-LIGHTNESS)
(gimp-brightness-contrast layer-tempb (* brightness 1.25) (* contrast 1.25))
(plug-in-gauss 1 img layer-tempb 2.0 2.0 0)
(gimp-image-insert-layer img layer-tempc 0 -1)
(gimp-edit-copy layer-tempb)
(gimp-floating-sel-anchor (car (gimp-edit-paste layer-tempc 0)))
; (plug-in-gimpressionist 1 img layer-tempc "ev_strokes45r.txt")
;(plug-in-gimpressionist 1 img layer-tempc "ev_strokes45ra")
(if (= customGimpress FALSE)
(begin
;(plug-in-gimpressionist 1 img layer-tempc "Furry")
;(plug-in-gimpressionist 1 img layer-tempc "Straws") ; Dotify; Embroidery ; Weave
(plug-in-gimpressionist 1 img layer-tempc "Dotify")
)
(begin
(plug-in-gimpressionist 1 img layer-tempc "ev_strokes45ra")
)
)
(plug-in-dog 1 img layer-tempc 2.3 13.2 TRUE TRUE)
;(gimp-threshold layer-tempc 250 255)
(if (= customGimpress FALSE)
(begin
(gimp-drawable-threshold layer-tempc HISTOGRAM-VALUE (/ customThresh 100) 1.0) ; was 0.95; was 0.2415
)
(begin
(gimp-drawable-threshold layer-tempc HISTOGRAM-VALUE (/ customThresh 100) 1.0) ; was 0.95; was 0.2415
)
)
;(gimp-message "line 146")
(gimp-displays-flush)
(gimp-layer-set-mode layer-tempc LAYER-MODE-MULTIPLY) ; was 3
(gimp-layer-set-mode layer-tempb LAYER-MODE-MULTIPLY)
(gimp-item-set-name layer-tempc "layer-tempc")
(gimp-item-set-name layer-tempb "layer-tempb")
(gimp-image-merge-down img layer-tempc 0)
(set! layer-tempb (car (gimp-image-get-active-layer img)))
(gimp-displays-flush)
(gimp-image-merge-down img layer-tempb 0)
(set! layer-tempa (car (gimp-image-get-active-layer img)))
(gimp-edit-copy layer-tempa)
;(gimp-message "line 161")
(gimp-displays-flush)
;(quit)
; (set! img2 (car (gimp-image-new width height image-type)))
; (set! layer-temp2 (car (gimp-layer-new img2 width height layer-type "temp2" 100 NORMAL-MODE)))
(gimp-image-insert-layer img2 layer-temp2 0 -1)
(gimp-drawable-fill layer-temp2 FILL-TRANSPARENT)
(gimp-floating-sel-anchor (car (gimp-edit-paste layer-temp2 0)))
(gimp-image-convert-indexed img2 0 4 0 0 0 "conte_ev8")
(gimp-edit-copy layer-temp2)
;(gimp-display-new img2)
(gimp-image-delete img2)
(gimp-displays-flush)
(gimp-layer-add-alpha layer-tempa)
(gimp-floating-sel-anchor (car (gimp-edit-paste layer-tempa 0)))
(gimp-item-set-name layer-tempa "layer-tempa")
(gimp-image-insert-layer img layer-tempd 0 -1)
(gimp-edit-copy layer-tempa)
(gimp-floating-sel-anchor (car (gimp-edit-paste layer-tempd 0)))
(gimp-item-set-name layer-tempd "layer-tempd")
(gimp-displays-flush)
(if (= wild? TRUE)
(begin
;(gimp-message "line 188")
(if (= customGimpress FALSE)
(begin
;(plug-in-gimpressionist 1 img layer-tempd "Line-art")
;(plug-in-gimpressionist 1 img layer-tempd "Line-art-2")
(plug-in-gimpressionist 1 img layer-tempd "Straws")
)
(begin
(plug-in-gimpressionist 1 img layer-tempd "graphite2")
)
)
)
)
(gimp-displays-flush)
(gimp-layer-set-mode layer-tempd LAYER-MODE-HARDLIGHT) ; was 19
(if (= inMerge TRUE)
(gimp-image-merge-down img layer-tempd 0)
)
(set! layer-tempa (car (gimp-image-get-active-layer img)))
;(gimp-message "line 181")
(gimp-displays-flush)
(if (= canvas? TRUE)
(begin
;(gimp-message "line 209 canvas")
(gimp-image-insert-layer img layer-tempe 0 -1)
(gimp-context-set-foreground '(234 220 190))
(gimp-drawable-fill layer-tempe FILL-FOREGROUND)
(plug-in-apply-canvas 1 img layer-tempe 1 3)
(gimp-layer-set-mode layer-tempe LAYER-MODE-DARKEN-ONLY) ; was tempa
(gimp-displays-flush)
;(gimp-image-lower-item img layer-tempe)
;(gimp-image-merge-down img layer-tempa 0)
(set! layer-tempa (car (gimp-image-get-active-layer img)))
)
)
;-------------------------------------------------------
(gimp-image-select-item img CHANNEL-OP-REPLACE old-selection)
(gimp-selection-invert img)
(if (eqv? (car (gimp-selection-is-empty img)) FALSE) ; both Empty and All are denied
(begin
(gimp-edit-clear layer-tempa)
)
)
;(gimp-message "line 205")
(gimp-item-set-name layer-tempa "Conte")
(gimp-image-select-item img CHANNEL-OP-REPLACE old-selection)
(gimp-image-remove-channel img old-selection)
(if (= inMerge TRUE)
(gimp-image-merge-visible-layers img EXPAND-AS-NECESSARY)
)
(gimp-message "Good finish OK")
(gimp-image-undo-group-end img)
(gimp-displays-flush)
(gc) ; may be unnecessary
)
)
(script-fu-register
"FU-conte"
"<Toolbox>/Script-Fu/Artist/Conte charcoal crayon"
"Creates an image that looks like a conte sketch. Produces Conte Red effect. \n file:FU_artist_conte.scm"
"Eddy Verlinden <[email protected]>"
"karlhof26"
"2007, juli"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT "Brightness" '(50 -100 100 1 10 0 0)
SF-ADJUSTMENT "Contrast" '(30 -100 100 1 10 0 0)
SF-TOGGLE "Wild" FALSE
SF-TOGGLE "Canvas" TRUE
SF-TOGGLE "Merge layers when complete?" FALSE
SF-TOGGLE "Use Custom gimpressionist settings" FALSE
SF-ADJUSTMENT "Scratch/hatch Threshold" '(92 50 100 1 10 0 0)
)
; end of script