-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpatdavid-check-layer.scm
90 lines (71 loc) · 3.4 KB
/
patdavid-check-layer.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
; Blue-Channel skin "Check Layer"
; Created by Patrick David <[email protected]>
;
; No adjustment layers in GIMP, so add some solid color layers,
; subtract them from the image to isolate the blue channel
; automatically adjust the contrast to match the blue channel exactly.
;
; Then work on healing/cloning in the base layer, and the results
; will instantly show up in your "check layer"!
; See: http://blog.patdavid.net/2013/04/getting-around-in-gimp-blue-channel.html
; 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-patdavid-check-layer Image Drawable)
(let*
( ;define vars
(Red (car (gimp-layer-new-from-drawable Drawable Image)))
(Green (car (gimp-layer-new-from-drawable Drawable Image)))
(Yellow (car (gimp-layer-new-from-drawable Drawable Image)))
(White (car (gimp-layer-new-from-drawable Drawable Image)))
(Dodge (car (gimp-layer-new-from-drawable Drawable Image)))
)
(gimp-image-undo-group-start Image)
;(gimp-drawable-set-name Red "-Red")
;(gimp-context-set-foreground '(255 0 0))
;(gimp-drawable-fill Red FOREGROUND-FILL)
;(gimp-image-insert-layer Image Red 0 -1)
;(gimp-layer-set-mode Red SUBTRACT-MODE)
;(gimp-drawable-set-name Green "-Green")
;(gimp-context-set-foreground '(0 255 0))
;(gimp-drawable-fill Green FOREGROUND-FILL)
;(gimp-image-insert-layer Image Green 0 -1)
;(gimp-layer-set-mode Green SUBTRACT-MODE)
(gimp-drawable-set-name Yellow "-Yellow")
(gimp-context-set-foreground '(255 255 0))
(gimp-drawable-fill Yellow FOREGROUND-FILL)
(gimp-image-insert-layer Image Yellow 0 -1)
(gimp-layer-set-mode Yellow SUBTRACT-MODE)
(gimp-drawable-set-name White "-White")
(gimp-context-set-foreground '(255 255 255))
(gimp-drawable-fill White FOREGROUND-FILL)
(gimp-image-insert-layer Image White 0 -1)
(gimp-layer-set-mode White COLOR-MODE)
(gimp-drawable-set-name Dodge "-Dodge")
(gimp-context-set-foreground '(127 127 127))
(gimp-drawable-fill Dodge FOREGROUND-FILL)
(gimp-image-insert-layer Image Dodge 0 -1)
(gimp-layer-set-mode Dodge DODGE-MODE)
(gimp-image-set-active-layer Image Drawable)
(gimp-displays-flush)
(gimp-image-undo-group-end Image)
)
)
; Finally register our script with script-fu.
(script-fu-register "script-fu-patdavid-check-layer"
"Skin Check Layer..."
"Generates a blue layer monochrome view for checking skin immperfections"
"Patrick David <[email protected]>"
"Patrick David"
"2013-03-28"
"RGB*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)
(script-fu-menu-register "script-fu-patdavid-check-layer" "<Image>/Filters/Generic")