GIMP Forums

Full Version: batch despeckle
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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'm thankful for any kind of help!

Thanks Kevin!

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,

this looks great (in notepad), thank you very very much! I'll test it this evening (after doing some backups ...) and tell you how it went.

Thank you very much again,

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!
Hi Kevin,

since the skript was an scm, not an exe, I thought it should be started from gimp. Anyway - your skript runs smoothly! I really am thankful, this saves me weeks of work!

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!

Hi Ofnuts,

thank you for your prompt reply. My images are saved as tif, lzw-compressed, grayscale mode. I thus changed the command line in the dos batch file.
Are there other ways I messed the meta-data up?

Thank you!

Hi paynekj,

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!

Reference URL's