It is currently Tue Jun 09, 2026 5:06 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Gimp Tool brushes - with alpha
PostPosted: Fri Jul 20, 2012 11:13 am  (#1) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16023
viewtopic.php?f=8&t=4769&start=10#p59251

_________________
Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Gimp Tool brushes - with alpha
PostPosted: Fri Jul 20, 2012 11:47 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thank you so much Rod. How did you do them all. I was trying to do one at a time. I gave up after 3. Please...I need to know for the future.

Image

_________________
Image


Top
 Post subject: Re: Gimp Tool brushes - with alpha
PostPosted: Fri Jul 20, 2012 3:41 pm  (#3) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16023
molly wrote:
Thank you so much Rod. How did you do them all. I was trying to do one at a time. I gave up after 3. Please...I need to know for the future.

Image


I did them all with the batch script first and that didn't work. So i had to do them all one at a time.
I opened all the transparent images as layers in Gimp-2.8.1, and made all the layers invisible except the working layer. Then i just created a brush with each one.Took some time but was well worth it in my opinion. :bigthup
I have no idea why the brush batch script failed to save the alpha channel.

Does anyone want to create a script that creates batch brushes from layers keeping the transparency?

_________________
Image


Top
 Post subject: Re: Gimp Tool brushes - with alpha
PostPosted: Fri Jul 20, 2012 4:36 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thank you Rod, that was an undertaking for sure. A script would be great for that.

_________________
Image


Top
 Post subject: Re: Gimp Tool brushes - with alpha
PostPosted: Sat Jul 21, 2012 7:47 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Aug 24, 2011
Posts: 1785
Location: Dallas, TX
I really appreciate you doing this Rod. I was making my own pngs one at a time to do illustrations in combination with screenshots to use in my tutorials. Never dawned on me to make brushes out of them. Much easier now. Thanks again.

_________________
Image


Top
 Post subject: Re: Gimp Tool brushes - with alpha
PostPosted: Sat Jul 21, 2012 11:57 am  (#6) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2602
batch convert to gimp brushes,

I remember I once recommended this to someone and it does not work for .gbr brushes.

http://xoomer.virgilio.it/lwcon/gimp/sc ... resize.htm

You need to edit line 144 in the script and replace RGBA_IMAGE with 1

Still a pita to use as you need to generate a file listing and the brushes get named filename.ext.gbr so some good file editors and renamers come in handy and sensible choice of folder name as well.

but it does work & retains transparency. http://i.imgur.com/9mHtK.jpg
these are the icons from the gimp help files.


Top
 Post subject: Re: Gimp Tool brushes - with alpha
PostPosted: Sat Jul 21, 2012 12:31 pm  (#7) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16023
Actually that is a different scm i think.
I just needed to comment out the ( gimp-image-flatten image ) part and that works. :)

Line #29 - is the part i commented out.

Here is the script - it creates transparent brushes from transparent pngs or gif's in a directory in batch.
If you want to use it on non transparencies un comment out the line #29 again.
(define (script_fu_batch_brushes inDir inLoadType )
   (let*
      (
         (varLoadStr 0)
         (varSaveStr 0)
         (image 0)
         (drawable 0)
         (newfilename 0)
         (filename 0)
         (varFileList 0)
         (imagetype 0)
         (handler (car (gimp-message-get-handler)))
      )
      (set! varLoadStr
         (cond
            (( equal? inLoadType 0 ) ".jpg" )
            (( equal? inLoadType 1 ) ".bmp" )
            (( equal? inLoadType 2 ) ".png" )
            (( equal? inLoadType 3 ) ".gif" )
            (( equal? inLoadType 4 ) ".xcf" )
         )
      )
      (set! varFileList (cadr (file-glob (string-append inDir DIR-SEPARATOR "*" varLoadStr)  1)))

      (while (not (null? varFileList))
         (set! filename (car varFileList))
         (set! image (car (gimp-file-load 1 filename filename)))
         (set! newfilename (string-append (substring filename 0 (- (string-length filename) 4)) ".gbr"))
         ;(gimp-image-flatten image)
         (set! imagetype (gimp-image-base-type image))
         ;(when (not (= imagetype 1))
         ;   (gimp-image-convert-grayscale image)
         ;)
         (set! drawable (car (gimp-image-get-active-layer image)))
         (gimp-file-save 1 image drawable newfilename newfilename)
         (gimp-image-delete image)
         (set! varFileList (cdr varFileList))
      )
   )
)

(script-fu-register "script_fu_batch_brushes"
   "<Image>/Filters/Batch Tools/Batch convert to brushes..."
   "Create Brushes for all files in a directory"
   "Emily Smirle"
   "Emily Smirle"
   "July 2010"
   ""
   SF-DIRNAME    "Load from" ""
   SF-OPTION     "Load File Type" (list "jpg" "bmp" "png" "gif" "xcf")
)


Image

Image

Script is also attached just place it in your scripts folder
You will find it under Filters>Batch-Tools>

Attachment:
batch_brushes.scm [1.48 KiB]
Downloaded 327 times

_________________
Image


Top
 Post subject: Re: Gimp Tool brushes - with alpha
PostPosted: Sat Jul 21, 2012 1:13 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thank you Rod.

_________________
Image


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group