0

Very new to Gimp and unfortunately also in need of producing an output :)

I am looking to automate a repetitive task of placing instances of existing brushes in an image. Can anyone point me in the direction of the command that I might use to achieve this, or tell me if this is even possible with Gimp scripting?

many thanks

Paul Eden
  • 338
  • 1
  • 3
  • 10
  • What do you mean with "placing isntances of existing brushes in an image"? Just a stamp of each brush? Or do you require that for animated brushes, there is a stamp of all it's cells? Should the brush name be stamped as well? – jsbueno Mar 25 '14 at 05:48

1 Answers1

0

Yes, if by this question you mean to "stamp" each brush in the imagem it is possible to do that via scriptting.

I'd recomend setting to Python for that - it is not a little bit complicated because yu willhave to deal with with things like image width, and such in order to fit all brushes - but it should be less than 30 lines of code.

It can be done interactively from filters->Python-fu->console - from there you can make PDB calls - press the "browse" button to check what is available.

You can do, for example, just create a new image in GIMP, open up the Python console, and paste this code into it:

img = gimp.image_list()[0]

SIZE = 30

brush_list = pdb.gimp_brushes_get_list(None)[1]

x, y = 0,0
pdb.gimp_context_set_brush_size(SIZE)
for brush in brush_list:
    pdb.gimp_context_set_brush(brush)
    pdb.gimp_paintbrush_default(img.layers[0], 2, [x + SIZE // 2,y + SIZE // 2])
    x += SIZE
    if x + SIZE >= img.width:
        x = 0
        y += SIZE

pdb.gimp_displays_flush()
jsbueno
  • 99,910
  • 10
  • 151
  • 209