I need a bit of help, please, with scripting a batch process for GIMP. I hope that I'm asking on the right forum; if there is a better place to ask, please point me in the right direction. (I'm an absolute beginner when it comes to GIMP scripting.)
I have a bunch of images that I wish to process with script-fu-pencil-drawing. For simplicity's sake, I'll talk about just a single image in this post.
I have used the tutorial for GIMP batch scripting. Taking the tutorial's example verbatim works perfectly. But when I adjust the script for script-fu-pencil-drawing, I get an error.
Note that script-fu-pencil-drawing works when used interactively; it is only when used in this batch script that it fails.
Here is the script as I've adjusted it. The changes are highlighted.
Code:
(define (simple-script-fu-pencil-drawing filename
radius
strength
mergelayers)
(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(script-fu-pencil-drawing RUN-NONINTERACTIVE
image drawable radius strength mergelayers)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)))
Here is the command that I run on the command line, where foo.png is the image to be processed. Again, changes are highlighted.
Code:
gimp -i -b '(simple-script-fu-pencil-drawing "foo.png" 8.0 16.0 TRUE)' -b '(gimp-quit 0)'
Here is the output. The original foo.png is left unchanged.
Code:
GIMP-Error: Calling error for procedure 'gimp-layer-copy':
Procedure 'gimp-layer-copy' has been called with an invalid ID for argument 'layer'. Most likely a plug-in is trying to work on a layer that doesn't exist any longer.
batch command experienced an execution error:
Error: ( : 1) Procedure execution of gimp-layer-copy failed on invalid input arguments: Procedure 'gimp-layer-copy' has been called with an invalid ID for argument 'layer'.
Most likely a plug-in is trying to work on a layer that doesn't exist any longer.
I have been at this for a couple of hours, and nothing that I've tried has worked. If you could help me fix this, please, I would be most grateful.
Bookmarks