Hi,
I'd like to get gimp to despeckle all images of one folder, with the options adaptive, recursive, Radius = 3, black level = -1 und white level = 256), afterwards save the images to another folder. Unfortunately I'm no programmer und don't get the tutorials to write a batch skript.
I know it should be

gimp -i -b '(skript "*.png" 1 2)' -b '(gimp-quit 0)'

[instead of 'skript' the despeckle funktion], but how to write it? And where to run the skript? In the folder, containing the gimp exe?

I use windows and don't have python on my PC.
There already is a despeckle plugin on e can find in the skript-fu repository. That works fine for me from the gimp GUI. I now only need to run it in batch mode. Maybe it isn't necessary to programm something new but to simply get it run from the command line? But how?
Thanks for any help!

Hi Kevin,
I copied the .scm-file into the gimp skripts folder, opend skript-fu via the filter menu, clicked refresh
skripts afterwards, but it doesn't show up in the skripts list. Was this the wrong way to deal with it?
Then, I don't get from where to start the DOS batch file. Where are the image files expected to be?
Thanks a lot!
kkiel

Hi Kevin and other readers looking for a solution for the despeckle problem:

The skript still works fine and the despeckling effect is just what I need, but Gimp destroys the iptc-data and maybe some other metadata (icc profile). My despeckled images wont show up in Lightroom and Faststone, though other readers (irfanview, imatch, xnview) don't have problems .
So I won't be able to use it like that. Does anybody know how to avoid that? Is it another line of code in the skript? There must be some metadata skripts in Gimp.
Thanks for any help!

Your problem is that you are using PNG and there is no provision for EXIF/IPTC/XMP in this format... There is only a provision for a generic text comment (and Gimp seems to have the code to support that).

So you have two solutions:

1) Use high quality JPEG. Yes, JPEG is a lossy format, but at hight quality the loss is negligible for most purposes(*), and in any case if would be far less than what you lose in the despeckling anyway... You could also use TIFF (which is a lossless format fit to save "natural" images, and also supports EXIF/TIFF/XMP). Gimp normally keeps these metadata for these formats.

2) use some command line utility to copy metadata between original and processed files.

(*) There is a lot of paronoia about data loss in JPEG. The usual argument is that you lose some each time you edit the file. This is untrue... The JPEG algorithm, when implemented properly, is stable. The decoded pixels are reencoded with the same values so there is zero loss. Change occurs when the computation is different which happens when:

1) Quality settings are changed, but this is in general for a lesser quality
2) General color processing is applied. Loss due to JPEG is smaller that the round-off errors caused by the 8-bit processing in Gimp.
3) File is cropped on a boundary that displaces the 8x8 pixels blocks.

In other cases, where only local edit is performed, unchanged pixels get reencoded with the same values, so the loss is restricted to the one caused by the original encoding.

I can afford to loose the IPTC-data because I can easily write them back with IMatch but what bothers me is that the images wont show up as a Lightroomthumbnail before importing ('no preview available') and as a Faststone thumbnail (thumbnails turn black). After importing to Lightroom though they are visible and Faststone will process the images further (lzw-compressing for example) without problems (though lightroom will have problems to show the previews of those before importing). I just want to make sure that standard image viewers will be able to cope with my images and that no seminal image information (icc profile, whatever) got lost.
So I will do some more checking before despeckling thousands of images ...
Thanks for your help!