Mobile app version of vmapp.org
Login or Join
Shanna688

: Reducing blur via GIMP command line I should preface this by stating that I'm a developer, not a graphic designer. I have a need to programmatically reduce image/video blur and have seen evidence

@Shanna688

Posted in: #Blur #Gimp #ImageEditing

I should preface this by stating that I'm a developer, not a graphic designer. I have a need to programmatically reduce image/video blur and have seen evidence that GIMP supports blur reduction:


Reduce motion blur using the GIMP; and
Smart Sharpening; etc.


I also see that GIMP has a "batch mode" command-line feature for doing bulk operations on lots of files at a time, and/or for typical shell/terminal usage.

I guess I'm wondering if any of these blur reduction/sharpening tools/utils are available on the GIMP command-line, where their documentation (if any exists) might be, and what some of the commands/arguments might look like.

Thanks in advance!

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Shanna688

2 Comments

Sorted by latest first Latest Oldest Best

 

@Dunderdale640

For simple sharpening, ImageMagick has a -sharpen operator:

convert foobar.jpg -sharpen 0x1.0 foobar-sharpened.jpg


As usual with ImageMagick, this can of course be part of a more complex processing.

There is also a very complete suite of image filters called G'MIC. They can be used in a command line or as Gimp filters, so a good technique is to use them in Gimp to figure out the most suitable processing & settings and then run them in command line mode for "production".

10% popularity Vote Up Vote Down


 

@Pierce403

For the most part, the features available in the UI are also available in batch mode.

Example script (shamelessly stolen from here)

(define (simple-unsharp-mask filename
radius
amount
threshold)
(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(plug-in-unsharp-mask RUN-NONINTERACTIVE
image drawable radius amount threshold)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)))


If you put this in your scripts directory, you can run it like this:

gimp -i -b '(simple-unsharp-mask "foo.png" 5.0 0.5 0)' -b '(gimp-quit 0)'


To find out what commands you can use in scripts, open GIMP and click Help > Procedure Browser.

I personally find GIMP script-fu difficult to write (it looks like Python in a blender) and use ImageMagick instead.

Edit

"Python in a blender" is more formally known as TinyScheme.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme