/usr/share/gimp/2.0/scripts/mkbrush.scm is in gimp-data 2.8.16-1ubuntu1.
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 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 | ; GIMP - The GNU Image Manipulation Program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; Make-Brush - a script for the script-fu program
; by Seth Burgess 1997 <sjburges@ou.edu>
;
; 18-Dec-2000 fixed to work with the new convention (not inverted) of
; gbr saver (jtl@gimp.org)
;
; 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/>.
(define (script-fu-make-brush-rectangular name width height spacing)
(let* (
(img (car (gimp-image-new width height GRAY)))
(drawable (car (gimp-layer-new img
width height GRAY-IMAGE
"MakeBrush" 100 NORMAL-MODE)))
(filename (string-append gimp-directory
"/brushes/r"
(number->string width)
"x"
(number->string height)
".gbr"))
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img drawable 0 0)
(gimp-context-set-background '(255 255 255))
(gimp-drawable-fill drawable BACKGROUND-FILL)
(gimp-image-select-rectangle img CHANNEL-OP-REPLACE 0 0 width height)
(gimp-context-set-background '(0 0 0))
(gimp-edit-fill drawable BACKGROUND-FILL)
(file-gbr-save 1 img drawable filename "" spacing name)
(gimp-image-delete img)
(gimp-context-pop)
(gimp-brushes-refresh)
(gimp-context-set-brush name)
)
)
(script-fu-register "script-fu-make-brush-rectangular"
_"_Rectangular..."
_"Create a rectangular brush"
"Seth Burgess <sjburges@ou.edu>"
"Seth Burgess"
"1997"
""
SF-STRING _"Name" "Rectangle"
SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1)
SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1)
SF-ADJUSTMENT _"Spacing" '(25 1 100 1 10 1 0)
)
(script-fu-menu-register "script-fu-make-brush-rectangular"
"<Brushes>")
(define (script-fu-make-brush-rectangular-feathered name width height
feathering spacing)
(let* (
(widthplus (+ width feathering))
(heightplus (+ height feathering))
(img (car (gimp-image-new widthplus heightplus GRAY)))
(drawable (car (gimp-layer-new img
widthplus heightplus GRAY-IMAGE
"MakeBrush" 100 NORMAL-MODE)))
(filename (string-append gimp-directory
"/brushes/r"
(number->string width)
"x"
(number->string height)
"f"
(number->string feathering)
".gbr"))
)
(gimp-context-push)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img drawable 0 0)
(gimp-context-set-background '(255 255 255))
(gimp-drawable-fill drawable BACKGROUND-FILL)
(cond
((< 0 feathering)
(gimp-context-set-feather TRUE)
(gimp-context-set-feather-radius feathering feathering)
(gimp-image-select-rectangle img CHANNEL-OP-REPLACE
(/ feathering 2) (/ feathering 2) width height))
((>= 0 feathering)
(gimp-context-set-feather FALSE)
(gimp-image-select-rectangle img CHANNEL-OP-REPLACE 0 0 width height))
)
(gimp-context-set-background '(0 0 0))
(gimp-edit-fill drawable BACKGROUND-FILL)
(file-gbr-save 1 img drawable filename "" spacing name)
(gimp-image-delete img)
(gimp-context-pop)
(gimp-brushes-refresh)
(gimp-context-set-brush name)
)
)
(script-fu-register "script-fu-make-brush-rectangular-feathered"
_"Re_ctangular, Feathered..."
_"Create a rectangular brush with feathered edges"
"Seth Burgess <sjburges@ou.edu>"
"Seth Burgess"
"1997"
""
SF-STRING _"Name" "Rectangle"
SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1)
SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1)
SF-ADJUSTMENT _"Feathering" '(4 1 100 1 10 0 1)
SF-ADJUSTMENT _"Spacing" '(25 1 100 1 10 1 0)
)
(script-fu-menu-register "script-fu-make-brush-rectangular-feathered"
"<Brushes>")
(define (script-fu-make-brush-elliptical name width height spacing)
(let* (
(img (car (gimp-image-new width height GRAY)))
(drawable (car (gimp-layer-new img
width height GRAY-IMAGE
"MakeBrush" 100 NORMAL-MODE)))
(filename (string-append gimp-directory
"/brushes/e"
(number->string width)
"x"
(number->string height)
".gbr"))
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img drawable 0 0)
(gimp-context-set-background '(255 255 255))
(gimp-drawable-fill drawable BACKGROUND-FILL)
(gimp-context-set-background '(0 0 0))
(gimp-image-select-ellipse img CHANNEL-OP-REPLACE 0 0 width height)
(gimp-edit-fill drawable BACKGROUND-FILL)
(file-gbr-save 1 img drawable filename "" spacing name)
(gimp-image-delete img)
(gimp-context-pop)
(gimp-brushes-refresh)
(gimp-context-set-brush name)
)
)
(script-fu-register "script-fu-make-brush-elliptical"
_"_Elliptical..."
_"Create an elliptical brush"
"Seth Burgess <sjburges@ou.edu>"
"Seth Burgess"
"1997"
""
SF-STRING _"Name" "Ellipse"
SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1)
SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1)
SF-ADJUSTMENT _"Spacing" '(25 1 100 1 10 1 0)
)
(script-fu-menu-register "script-fu-make-brush-elliptical"
"<Brushes>")
(define (script-fu-make-brush-elliptical-feathered name
width height
feathering spacing)
(let* (
(widthplus (+ feathering width)) ; add 3 for blurring
(heightplus (+ feathering height))
(img (car (gimp-image-new widthplus heightplus GRAY)))
(drawable (car (gimp-layer-new img
widthplus heightplus GRAY-IMAGE
"MakeBrush" 100 NORMAL-MODE)))
(filename (string-append gimp-directory
"/brushes/e"
(number->string width)
"x"
(number->string height)
"f"
(number->string feathering)
".gbr"))
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img drawable 0 0)
(gimp-context-set-background '(255 255 255))
(gimp-drawable-fill drawable BACKGROUND-FILL)
(cond ((> feathering 0) ; keep from taking out gimp with stupid entry.
(gimp-context-set-feather TRUE)
(gimp-context-set-feather-radius feathering feathering)
(gimp-image-select-ellipse img CHANNEL-OP-REPLACE
(/ feathering 2) (/ feathering 2)
width height))
((<= feathering 0)
(gimp-context-set-feather FALSE)
(gimp-image-select-ellipse img CHANNEL-OP-REPLACE 0 0 width height)))
(gimp-context-set-background '(0 0 0))
(gimp-edit-fill drawable BACKGROUND-FILL)
(file-gbr-save 1 img drawable filename "" spacing name)
(gimp-image-delete img)
(gimp-context-pop)
(gimp-brushes-refresh)
(gimp-context-set-brush name)
)
)
(script-fu-register "script-fu-make-brush-elliptical-feathered"
_"Elli_ptical, Feathered..."
_"Create an elliptical brush with feathered edges"
"Seth Burgess <sjburges@ou.edu>"
"Seth Burgess"
"1997"
""
SF-STRING _"Name" "Ellipse"
SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1)
SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1)
SF-ADJUSTMENT _"Feathering" '(4 1 100 1 10 0 1)
SF-ADJUSTMENT _"Spacing" '(25 1 100 1 10 1 0)
)
(script-fu-menu-register "script-fu-make-brush-elliptical-feathered"
"<Brushes>")
|