New deals posted everyday, starting Black Friday and running through the holiday season! No hassles, no lines - just awesome savings on art, deviantWEAR, Premium Memberships and more!
Details
April 1, 2006
2.3 KB 9.8 KB 256×256 Statistics |
Comments
(define (brush-batch load opt name filename spacing location)
(let* ( (a (cond
(( equal? opt 0 ) ".jpg" )
(( equal? opt 1 ) ".bmp" )
(( equal? opt 2 ) ".xcf" )
(( equal? opt 3 ) ".png" )
(( equal? opt 4 ) ".gif" )
))
(filelist (cadr (file-glob (string-append load "\\*" a) 1)))
(s 1)
(drawable 0)
(selection-bounds 0)
(sx1 0)
(sy1 0)
(sx2 0)
(sy2 0)
(swidth 0)
(sheight 0)
(newimage 0)
(newlayer 0)
(active 0)
(filename2 0)
)
(while (pair? filelist)
(let* (
(loadfile (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE loadfile loadfile)))
)
(gimp-image-flatten image)
(set! drawable (gimp-image-get-active-drawable image))
(if (= 1 (car (gimp-selection-is-empty image)))
(gimp-selection-all image))
(gimp-displays-flush)
(gimp-edit-copy (car drawable) )
(set! selection-bounds (gimp-selection-bounds image))
(set! sx1 (cadr selection-bounds))
(set! sy1 (caddr selection-bounds))
(set! sx2 (cadr (cddr selection-bounds)))
(set! sy2 (caddr (cddr selection-bounds)))
(gimp-image-delete image)
(set! swidth (- sx2 sx1))
(set! sheight (- sy2 sy1))
(set! newimage (gimp-image-new swidth sheight 0))
(set! newlayer (gimp-layer-new (car newimage) swidth sheight 1 "newlayer" 100 0))
(gimp-image-add-layer (car newimage) (car newlayer) 0)
(gimp-drawable-fill (car newlayer) 3)
(gimp-edit-paste (car newlayer) 0 )
(gimp-image-flatten (car newimage))
(set! active(gimp-image-get-active-drawable (car newimage)))
(gimp-desaturate (car active))
(gimp-image-convert-grayscale (car newimage))
(gimp-displays-flush)
(gimp-selection-all (car newimage))
(set! filename2 (string-append location "/" filename (string-append (number->string s))".gbr"
))
(file-gbr-save 1 (car newimage) (car active) filename2 (string-append name (number->string s)) spacing (string-append name (number->string s))))
(set! s (+ s 1))
(gimp-image-delete (car newimage))
(set! filelist (cdr filelist))))
)
(script-fu-register "brush-batch"
"<Toolbox>/Xtns/Script-Fu/Gimp-talk.com/Brush-batch..."
"turns a folder of files into brush's works with jpg, bmp, xcf, png and gif"
"Karl Ward"
"Karl Ward"
"April 2006"
""
SF-DIRNAME "Load from" ""
SF-OPTION "File Type"'("jpg" "bmp""xcf""png""gif")
SF-STRING "Brush Name" "name"
SF-STRING "File Name" "filename"
SF-ADJUSTMENT "spacing" '(25 0 1000 1 1 1 0)
SF-DIRNAME "SAVE TO FOLDER" "")
--
I'm a human! I might be a little cursed, but I'm still a human!
So if you could give a better detail on what to do if your computer says it can not be found and to open it up in something..
Also, you said to save it as a .scm well it was already a .scm...
Error while executing
(brush-batch "C:\\Documents and Settings\\Ashley\\Desktop\\brush Stuff\\PNG dump" 3 "Urban_Scrawl_by_InvisibleSnow" "Urban_Scrawl_by_InvisibleSnow" 25 "C:\\Program Files\\GIMP-2.0\\share\\gimp\\2.0\\brushes")
Error: set!: unbound variable: a
so yeah, I dunno whats wrong and I am like seriously about ready to scream.
I am using Gimp 2.4.6
--
Bakaratsul, guardian of the skies
--
They taped over your mouth
Scribbled out the truth with their lies
Your little spies.
--
They taped over your mouth
Scribbled out the truth with their lies
Your little spies.