Book Image

GIMP 2.6 cookbook

By : Juan Manuel Ferreyra
Book Image

GIMP 2.6 cookbook

By: Juan Manuel Ferreyra

Overview of this book

<p>The GIMP (GNU Image Manipulation Program) is a freely distributed piece of software for such tasks as photo retouching, image composition, and image authoring, and is a viewed by many as a rival to commercial applications like Photoshop. The GIMP is one of Open Source's legendary applications &ndash; renowned for its power and flexibility, but daunting to new users and with a steep learning curve to mastery.</p> <p>This book is packed with answers to get you preparing great images with the GMP immediately. Even if you are a relative novice to this powerhouse application, the straightforward instructions will guide you through the tasks to unleash your true creativity without being hindered by the system.</p> <p><i>GIMP 2.6 Cookbook</i> begins with simple tasks like drawing and painting and then moves into the deeper and more rewarding areas of filters, effects, text, and fonts. You will learn how to create fantastic logos, scintillating effects, and beautiful backgrounds. Experiment with color and sharpness and also create a web design layout for your website. Imagine how great you will feel when you are equipped to create wonderful images that can give your website a much-deserved makeover.</p> <p>Straightforward instructions guide you through tasks with the GIMP to unleash your true creativity without being hindered by the complexity of the system</p> <p>&nbsp;</p> <p><b></b></p> <h3><b><center>Practical recipes with real results:</center></b></h3> <p style="text-align: center;"><img src="https://www.packtpub.com/sites/default/files/gimp_cookbook_create_web_graphics.jpg" border="0" width="580" height="939" /></p> <p>&nbsp;</p>
Table of Contents (17 chapters)
GIMP 2.6 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Command-line arguments


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.

-?, --help

Display a list of all command line options.

--help-all

Show all help options.

--help-gtk

Show GTK+ options.

-v, --version

Print the GIMP version and exit.

--license

Show license information and exit.

--verbose

Show detailed start-up messages.

-n, --new-instance

Start a new GIMP instance.

-a, --as-new

Open images as new.

-i, --no-interface

Run without a user interface.

-d, --no-data

Do not load patterns, gradients, palettes, or brushes. Often useful in non-interactive situations where the start-up time is to be minimized.

-f, --no-fonts

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.

-s, --no-splash

Do not show the splash screen while starting.

--no-shm

Do not use shared memory between GIMP and plugins.

--no-cpu-accel

Do not use special CPU acceleration functions. Useful for finding or disabling buggy accelerated hardware or functions.

--session=name

Use a different sessionrc for this GIMP session. The given session name is appended to the default sessionrc filename.

--gimprc=filename

Use an alternative gimprc instead of the default one. The gimprc file contains a record of your preferences. Useful in cases where plugins paths or machine specifications may be different.

--system-gimprc=filename

Use an alternate system gimprc file.

-b, --batch=commands

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 -, commands are read from standard input.

--batch-interpreter=proc

Specify the procedure to use to process batch commands. The default procedure is Script-Fu.

--console-messages

Do not popup dialog boxes on errors or warnings. Print the messages on the console instead.

--pdb-compat-mode=mode

PDB compatibility mode (off|on|warn).

--stack-trace-mode=mode

Debug in case of a crash (never|query|always).

--debug-handlers

Enable non-fatal debugging signal handlers. Useful for GIMP debugging.

--g-fatal-warnings

Make all warnings fatal. Useful for debugging.

--dump-gimprc

Output a gimprc file with default settings. Useful if you messed up the gimprc file.

--display=display

Use the designated X display (does not apply to all platforms).

Batch mode

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.