GIMP can be run with no command line at all, but a few of them are useful when you have to process more than one file—this is called a batch job. There are many tasks that can be automated with GIMP, from basic operations such as applying a filter to complex tasks.
|
Display a list of all command line options. |
|
Show all help options. |
|
Show GTK+ options. |
|
Print the GIMP version and exit. |
|
Show license information and exit. |
|
Show detailed start-up messages. |
|
Start a new GIMP instance. |
|
Open images as new. |
|
Run without a user interface. |
|
Do not load patterns, gradients, palettes, or brushes. Often useful in non-interactive situations where the start-up time is to be minimized. |
|
Do not load any fonts. This is useful to load GIMP faster for scripts that do not use fonts, or to find problems related to malformed fonts that hang GIMP. |
|
Do not show the splash screen while starting. |
|
Do not use shared memory between GIMP and plugins. |
|
Do not use special CPU acceleration functions. Useful for finding or disabling buggy accelerated hardware or functions. |
|
Use a different |
|
Use an alternative |
|
Use an alternate system |
|
Execute the set of commands non-interactively. The set of commands is typically in the form of a script that can be executed by one of the GIMP scripting extensions. When the command is |
|
Specify the procedure to use to process batch commands. The default procedure is Script-Fu. |
|
Do not popup dialog boxes on errors or warnings. Print the messages on the console instead. |
|
PDB compatibility mode ( |
|
Debug in case of a crash ( |
|
Enable non-fatal debugging signal handlers. Useful for GIMP debugging. |
|
Make all warnings fatal. Useful for debugging. |
|
Output a |
|
Use the designated X display (does not apply to all platforms). |
To process the same operations on a set of files, GIMP provides a command-line batch mode that works with the Script-Fu scripting language. Using the -b
parameter GIMP enters in interactive mode. Here's a simple script to apply the Unsharp Mask filter to a file and overwrite the original:
(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)))
Select the file with a .scm
extension inside the ~/.gimp-2.6/scripts
directory and call it with the following parameters:
gimp -i -b '(simple-unsharp-mask "foo.png" 5.0 0.5 0)' -b '(gimp-quit 0)'
foo.png
is the file to which you want to apply the Unsharp Mask filter. There are a few numeric parameters that are specific for the filter after the file name.