Join for FREE | Take the Tour Lost Password?
Shop deviantART for the
holidays and save BIG!
Click here! :holly:
[x]

deviantART

:deviation:
 
©2006-2009 ~kward1979uk
:iconkward1979uk:

Artist's Comments

Automatically opens files from a selected folder and converts them into brush's for use with GIMP

works with the following file types

.jpg
.bmp
.xcf
.png
.gif

this script has been tested using windows and im not sure it will work with linux as i dont have linux installed.

Comments


:iconffaat:
Following is the script modified to work with Tinyscheme (gimp 2.4+)

(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" "")
:iconwolfoffallenshadows:
YOU FREAKING ROCK!!! Thank you so much, you have just saved me a ton of time and money.

--
I'm a human! I might be a little cursed, but I'm still a human!
:iconmizz-wednesday:
Ok, so I downloaded your converter thing, it said the file could not be found and asked me to open it in another program like notepad...so I did and all it did was give me a bunch of nothing which didn't help at all.

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...
:iconmizz-wednesday:
Ok, so I found a website that shows you how to get them to .png and then the whole .abrviewer and what not, now when I tried to do the whole, "Gimp-talk.com > Brush batch it gave me this:

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.
:iconmizz-wednesday:
ok ok...
I am using Gimp 2.4.6
:iconomnitelik:
wow... so i just wasted HOW MANY HOURS?! lol ^^ oh well... *sigh* now to try it again... wish i knew that sooner... thanks!

--
Bakaratsul, guardian of the skies
:iconjailbirdblues:
Mk, have you not been told that Photoshop brushes are a .abr file type?

--
They taped over your mouth
Scribbled out the truth with their lies
Your little spies.     
:iconjailbirdblues:
o.O this is confusing, holy hell! all i wanted was to convert some paramore brushes from photoshop to gimp... whoaa

--
They taped over your mouth
Scribbled out the truth with their lies
Your little spies.     
:iconkward1979uk:
if your using the latest version of gimp you will not need to convert them as GIMP can now use photoshop brushes

Details

April 1, 2006
2.3 KB
9.8 KB
256×256

Statistics

169
154 [who?]
77,851 (13 today)
40,998 (6 today)

Site Map