/usr/share/gimp/2.0/scripts/BW-Film-Simulation-1.1.scm is in gimp-plugin-registry 5.20120621.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Serge Mankovski B/W Film Simulation
;
; Copyright Serge Mankovski (sevato@mankovski.com)
; Toronto, Ontario, 2007
;
; Version 1.1 March 30, 2007
;
; Converts selected layer into Black and White using channel mixer
; Uses channel presets found on Internet. I am not sure about the origin of these
; settings and I do not know if they really produce result resembling tonal qualities of
; the film, but it produces nice looking B/W and it is a useful way to convert to black and white
;
; Change Log:
; Version 1.1
; - added IR film simulation
; - added color filters applied before b/w conversion
; - added saturation option
; - Gimp 2.3.15+ support
;
; Version 1.1.1 Various fixes by Ari Pollak - thanks!
;
; 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.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (create-new-layer img drawable)
(let ((layer drawable))
(set! layer (car (gimp-layer-copy drawable TRUE)))
(gimp-image-add-layer img layer -1)
layer))
(define (script-fu-bw-film img drawable film filter rename new-layer increase-local-contrast auto-levels drop-gamma saturate )
(let
((bw-layer nil)
(chan-name ""))
(gimp-image-undo-group-start img) ; Start an undo group.
(if (equal? new-layer TRUE)
(set! bw-layer (create-new-layer img drawable))
(set! bw-layer drawable)
)
; (if (equal? auto-levels TRUE) (gimp-levels-stretch bw-layer) ())
(if (equal? saturate TRUE)
(plug-in-colors-channel-mixer 1 img bw-layer FALSE 1.3 -0.15 -0.15 -0.15 1.3 -0.15 -0.15 -0.15 1.3)
())
(if (equal? drop-gamma TRUE) (gimp-levels bw-layer 0 0 255 0.9 0 255) ())
(cond
; Yellow Filter
((= filter 1)
(gimp-hue-saturation bw-layer 0 -5 0 33)
(set! chan-name (string-append chan-name " Yellow Filter")))
; Orange Filter
((= filter 2)
(gimp-hue-saturation bw-layer 0 -20 0 25)
(set! chan-name (string-append chan-name " Orange Filter")))
; Red Filter
((= filter 3)
(gimp-hue-saturation bw-layer 0 -41 0 25)
(set! chan-name (string-append chan-name " Red Filter")))
; Green Filter
((= filter 4)
(gimp-hue-saturation bw-layer 0 90 0 33)
(set! chan-name (string-append chan-name " Green Filter")))
; Blue Filter
((= filter 5)
(gimp-hue-saturation bw-layer 0 -145 0 25)
(set! chan-name (string-append chan-name " Blue Filter")))
)
(cond
; Agfa 200X
((= film 0)
(set! chan-name (string-append chan-name " Agfa 200X"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.18 0.41 0.41 0.18 0.41 0.41 0.18 0.41 0.41 ))
; Agfapan 25
((= film 1)
(set! chan-name (string-append chan-name " Agfapan 25"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.25 0.39 0.36 0.25 0.39 0.36 0.25 0.39 0.36 ))
; Agfapan 100
((= film 2)
(set! chan-name (string-append chan-name " Agfapan 100"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.21 0.40 0.39 0.21 0.40 0.39 0.21 0.40 0.39 ))
; Agfapan 400
((= film 3)
(set! chan-name (string-append chan-name " Agfapan 400"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.20 0.41 0.39 0.20 0.41 0.39 0.20 0.41 0.39 ))
; Ilford Delta 100
((= film 4)
(set! chan-name (string-append chan-name " Ilford Delta 100"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.21 0.42 0.37 0.21 0.42 0.37 0.21 0.42 0.37 ))
; Ilford Delta 400
((= film 5)
(set! chan-name (string-append chan-name " Ilford Delta 400"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.22 0.42 0.36 0.22 0.42 0.36 0.22 0.42 0.36 ))
; Ilford Delta 400 Pro & 3200
((= film 6)
(set! chan-name (string-append chan-name " Ilford Delta 400 Pro & 3200"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.31 0.36 0.33 0.31 0.36 0.33 0.31 0.36 0.33 ))
; Ilford FP4
((= film 7)
(set! chan-name (string-append chan-name " Ilford FP4"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.28 0.41 0.31 0.28 0.41 0.31 0.28 0.41 0.31 ))
; Ilford HP5
((= film 8)
(set! chan-name (string-append chan-name " Ilford HP5"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.23 0.37 0.40 0.23 0.37 0.40 0.23 0.37 0.40 ))
; Ilford Pan F
((= film 9)
(set! chan-name (string-append chan-name " Ilford Pan F"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.33 0.36 0.31 0.33 0.36 0.31 0.33 0.36 0.31 ))
; Ilford SFX
((= film 10)
(set! chan-name (string-append chan-name " Ilford SFX"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.36 0.31 0.33 0.36 0.31 0.33 0.36 0.31 0.33 ))
; Ilford XP2 Super
((= film 11)
(set! chan-name (string-append chan-name " Ilford XP2 Super"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.21 0.42 0.37 0.21 0.42 0.37 0.21 0.42 0.37 ))
; Kodak Tmax 100
((= film 12)
(set! chan-name (string-append chan-name " Kodak Tmax 100"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.24 0.37 0.39 0.24 0.37 0.39 0.24 0.37 0.39 ))
; Kodak Tmax 400
((= film 13)
(set! chan-name (string-append chan-name " Kodak Tmax 400"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.27 0.36 0.37 0.27 0.36 0.37 0.27 0.36 0.37 ))
; Kodak Tri-X
((= film 14)
(set! chan-name (string-append chan-name " Kodak Tri-X"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.25 0.35 0.40 0.25 0.35 0.40 0.25 0.35 0.40 ))
; Kodak HIE
((= film 15)
(set! chan-name (string-append chan-name " Kodak HIE"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 1.0 1.0 -1.0 0.0 1.0 1.0 -1.0 0.0 1.0))
; Normal Contrast
((= film 16)
(set! chan-name (string-append chan-name " Normal Contrast"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.43 0.33 0.30 0.43 0.33 0.30 0.43 0.33 0.30 ))
; High Contrast
((= film 17)
(set! chan-name (string-append chan-name " High Contrast"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.40 0.34 0.60 0.40 0.34 0.60 0.40 0.34 0.60 ))
; Generic BW
((= film 18)
(set! chan-name (string-append chan-name " Generic BW"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.24 0.68 0.08 0.24 0.68 0.08 0.24 0.68 0.08 ))
; 50-50
((= film 19)
(set! chan-name (string-append chan-name " 50-50"))
(plug-in-colors-channel-mixer 1 img bw-layer TRUE 0.5 0.5 0.00 0.0 0.5 0.5 0.00 0.0 0.5 ))
)
(if (equal? rename TRUE) (gimp-drawable-set-name bw-layer chan-name) () )
(if (equal? increase-local-contrast TRUE) (plug-in-unsharp-mask 1 img bw-layer 30.0 0.25 9) ())
; Complete the undo group
(gimp-image-undo-group-end img)
; Flush the display
(gimp-displays-flush)))
(script-fu-register
"script-fu-bw-film"
"<Image>/Colors/BW Film Simulation"
"Black and White Film Simulation"
"Serge Mankovski (sevato@mankvoski.com)"
"2007, Serge Mankovski, Toronto, ON, Canada"
"05.01.2007"
"RGB*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Current Layer" 0
SF-OPTION "Film"
'(
"Agfa 200X"
"Agfapan 25"
"Agfapan 100"
"Agfapan 400"
"Ilford Delta 100"
"Ilford Delta 400"
"Ilford Delta 400 Pro & 3200"
"Ilford FP4"
"Ilford HP5"
"Ilford Pan F"
"Ilford SFX"
"Ilford XP2 Super"
"Kodak Tmax 100"
"Kodak Tmax 400"
"Kodak Tri-X"
"Kodak HIE"
"Normal Contrast"
"High Contrast"
"Generic BW"
"50/50"
)
SF-OPTION "Filter"
'(
"Select"
"Yellow"
"Orange"
"Red"
"Green"
"Blue"
)
SF-TOGGLE "Rename Layer?" TRUE
SF-TOGGLE "New Layer?" FALSE
SF-TOGGLE "Increase Local Contrast" FALSE
SF-TOGGLE "Auto Levels" FALSE
SF-TOGGLE "Drop Gamma 10%" FALSE
SF-TOGGLE "Saturate" FALSE
)
|