René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

Script-fu example 08: Drawing a circle

Creates a 250x250 picture and draws a filled circle into it. (See also ex_07)
This example is similar to example 12, but it uses gimp-edit-fill.html to fill the selected rectangle instead of gimp-edit-bucket-fill.
ex_08.scm
(define (ex_08)

  (let* (
          (my-image (car (gimp-image-new 250 250 RGB      )))
          (my-layer (car (gimp-layer-new my-image 250 250 RGB-IMAGE "my layer" 0 NORMAL)))
        )

        (gimp-image-add-layer my-image my-layer 0)

        (gimp-context-set-background '(010 020 030))
        (gimp-context-set-foreground '(255 245 235))

        (gimp-drawable-fill my-layer BACKGROUND-FILL)

        (gimp-ellipse-select my-image 25 25 200 200 REPLACE 1 0 0)
        (gimp-edit-fill my-layer FOREGROUND-FILL)

        (gimp-file-save RUN-NONINTERACTIVE my-image my-layer "c:\\temp\\ex_08.jpg" "")
  )
)

c:\> start gimp-2.2.exe -d -i -b  "(ex_08)" "(gimp-quit 0)"
See also other examples