You are here

Can I get gimp to open a new file, add effects, then export to a jpg with script-fu?

Hello. I am fairly new to gimp and have little to no experience writing scripts. I've been researching trying to figure out how to do the following with script-fu:

1. Open a new RGB file 640x480
2. Open filter/render/clouds/difference clouds dialogue.
3. Click on the "new seed" button.
4. Set the X,Y values to a random value.
5. Click OK.
6. Open colors/brightness-contrast dialogue.
7. Set the contrast to 120.
8. Click OK.
9. Open file/export dialogue.

I don't know if it's possible, but if it could automatically generate a sequential naming convention and export the file that would be ideal.
10. export file as .png or .jpg. with a sequential naming

Any help with this would be greatly appreciated. Sadly, I have had no luck even getting a script to just open a new file successfully. (Yes, I suck that bad.)

Can I get gimp to open a new file, add effects, then export to a jpg with script-fu?

The unbound variable error is owing to the fact you are using the variable name "drawable" when invoking 'script-fu-difference-clouds', yet the variable name "layer" is used for the rest of your script.

Note also that whenever you call a 'script-fu-*' procedure from within a Script-fu, you should leave out the run-mode argument (e.g., RUN-NONINTERACTIVE).

(script-fu-difference-clouds image layer)

Perhaps someone can help me with this error

> (define (random-target)
(let* ((image (car (gimp-image-new 640 480 RGB)))
(layer (car (gimp-layer-new image 640 480
RGB-IMAGE "LAYERTEST" 100 NORMAL-MODE))))
(gimp-drawable-fill layer BG-IMAGE-FILL)
(gimp-image-insert-layer image layer 0 1)
(gimp-display-new image)
(script-fu-difference-clouds RUN-INTERACTIVE image drawable)
TESTTARGET))
random-target
> (random-target)
Error: ( : 2) eval: unbound variable: drawable

I don't know why the drawable variable comes back as "unbound variable". Any help would be greatly appreciated. (Yes, you can talk to me like an I know nothing about scripting, because I really don't."

@wacmaster - Thanks but doesn't look like what I need

My purpose for this script is to generate unique random images, not for editing existing images. (I am testing image recognition software.) Thanks for the response though.

Have you tried BIMP?

Have you tried BIMP?
Batch Image Manipulation Plug-in
http://registry.gimp.org/node/26259

-Rod

Subscribe to Comments for "Can I get gimp to open a new file, add effects, then export to a jpg with script-fu?"