-
Notifications
You must be signed in to change notification settings - Fork 1
/
FU_artist_pastel.scm
136 lines (124 loc) · 5.02 KB
/
FU_artist_pastel.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
; FU_artist_pastel.scm
; version 2.9 [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
;
;==============================================================
;
; 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
; Pastel image script for GIMP 1.2
; Copyright (C) 2001 Iccii <iccii@hotmail.com>
;
; This script is based on pastel-windows100.scm
; version 0.1 by Iccii 2001/10/19 <iccii@hotmail.com>
; - Initial relase
;
; Reference Book: Windows100% Magazine October, 2001
; Tamagorou's Photograph touching up class No.29
; theme 1 -- Create the Pastel image
;==============================================================
(define (FU-artist-pastel
img
drawable
Dbord
detail
lengthIn
amount
angle
canvas?
inMerge
)
(gimp-image-undo-group-start img)
(if (not (= RGB (car (gimp-image-base-type img))))
(gimp-image-convert-rgb img))
(let* (
(Dbordx (cond ((= Dbord 0) 4) ((= Dbord 1) 0) ((= Dbord 2) 1) ((= Dbord 3) 2) ((= Dbord 4) 3) ((= Dbord 5) 5) ))
(old-selection (car (gimp-selection-save img)))
(layer-copy0 (car (gimp-layer-copy drawable TRUE)))
(dummy (if (< 0 (car (gimp-layer-get-mask layer-copy0)))
(gimp-layer-remove-mask layer-copy0 MASK-DISCARD)))
(layer-copy1 (car (gimp-layer-copy layer-copy0 TRUE)))
(lengthUse (if (= lengthIn 1) 0 lengthIn))
(layer-copy2 (car (gimp-layer-copy layer-copy0 TRUE)))
(merged-layer (car (gimp-layer-copy drawable TRUE)))
(final-layer (car (gimp-layer-copy drawable TRUE)))
)
(gimp-image-insert-layer img layer-copy0 0 -1)
(gimp-image-insert-layer img layer-copy2 0 -1)
(gimp-image-insert-layer img layer-copy1 0 -1)
(plug-in-mblur TRUE img layer-copy0 0 lengthUse angle TRUE TRUE);
(plug-in-mblur TRUE img layer-copy0 0 lengthUse (+ angle 180) TRUE TRUE)
(plug-in-gauss-iir TRUE img layer-copy1 (- 16 detail) TRUE TRUE)
(plug-in-edge TRUE img layer-copy1 6.0 0 Dbord)
(gimp-layer-set-mode layer-copy1 LAYER-MODE-DIVIDE)
(set! merged-layer (car (gimp-image-merge-down img layer-copy1 EXPAND-AS-NECESSARY)))
(gimp-layer-set-mode merged-layer LAYER-MODE-HSV-VALUE-LEGACY)
(if (equal? canvas? TRUE)
(plug-in-apply-canvas TRUE img merged-layer 0 5)
)
(plug-in-unsharp-mask TRUE img layer-copy0 (+ 1 (/ lengthUse 5)) amount 0)
(set! final-layer (car (gimp-image-merge-down img merged-layer EXPAND-AS-NECESSARY)))
(gimp-image-select-item img CHANNEL-OP-REPLACE old-selection)
(gimp-edit-copy final-layer)
(gimp-item-set-name final-layer "Pastel Layer")
(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-image-undo-group-end img)
(gimp-displays-flush)
)
)
(script-fu-register "FU-artist-pastel"
"<Image>/Script-Fu/Artist/Pastel"
"Create a Pastel image. \nfile:FU_artist_pastel.scm"
"Iccii <iccii@hotmail.com>"
"Iccii"
"2001, Oct"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-OPTION "Edge detection" '("Differential" "Sobel" "Prewitt" "Gradient" "Roberts" "Laplace")
SF-ADJUSTMENT "Detail Level" '(12.0 0 15.0 0.1 0.5 1 1)
SF-ADJUSTMENT "Sketch Length" '(5 0 32 1 1 0 1)
SF-ADJUSTMENT "Sketch Amount" '(2.0 0 5.0 0.1 0.5 1 1)
SF-ADJUSTMENT "Angle" '(45 0 180 1 15 0 0)
SF-TOGGLE "Add a canvas texture" FALSE
SF-TOGGLE "Merge layers when complete?" FALSE
)
; end of script