background preloader

Script Authoring

Facebook Twitter

Working with the Image. Text and images Copyright (C) 2002 Kevin Turner and may not be used without permission of the author.

Working with the Image

A plug-in is of limited use if it has nothing to do with the image. In this section, we explore the exciting world of GIMP image hierarchy, and learn how to manipulate it. In the beginning, there was Wilber, Wilber the gimp. The graphic was without form and void, and darkness was upon the face of the desktop, and the Spirit of Wilber was moving over the face of the bitstream. And Wilber said, "<Toolbox>File->New," and there was an image. ... or you could look at it the other way around. Most plug-ins care suprisingly little about these images. Drawables make life much more exciting. Basic GIMP Perl. Text and images Copyright (C) 1999-2002 Dov Grobgeld and may not be used without permission of the author.

Basic GIMP Perl

Editor's note: this tutorial was originally written for GIMP 1.2. Parts of it will not work with GIMP 2.x and later versions due to changes in font handling and PDB API. Intention So far most of the script programming for GIMP has been done using Scheme through Script-Fu. Unfortunately the Scheme environment GIMP provides is very primitive, e.g. without any reasonable error handling. Perl as a language is probably more familiar to web-literate users as it is the major language for writing CGI scripts. GIMP-Perl Debugged. Text and images Copyright (C) 2002 Seth Burgess and may not be used without permission of the author.

GIMP-Perl Debugged

Intention The Perl module for GIMP is a nice evolution of the scripting interface of GIMP. It removes the dependence on the relatively rarely encountered scheme language of script-fu and replaces it with one that is familiar to a much larger audience. In doing so, the perl interface to GIMP also can take advantage of many of the features that have been added to perl over the years. My aim in creating this tutorial is to make debugging scripts easier. To illustrate the points in this tutorial, this is a simple script that will change as we progress: #!

Gimp::set_trace The Gimp module provides tracing ability, which is a form of debugging. . #! This will give the maximum amount of tracing information, displayed on the console window you start GIMP from. Using TRACE_ALL can let you see easily what parameters are wrong so you can fix misbehaviour in scripts. Perl Debugger #! $DB::single Conclusion. Batch Mode. Introduction GIMP comes with a so-called batch mode that allows you to do image processing from the command line.

Batch Mode

It also makes it easy to apply the same set of operations to a number of images. We have got a lot of questions on the mailing-lists on how to use the batch mode and this small page tries to explain the basics to you. GIMP can be started with a number of command-line options. Let's have a closer look at the output of gimp --help: GIMP version 2.4.1 Usage: gimp [option ... ] [file ... ] Options: -? In order to do image processing from the command-line, you usually use the Script-Fu batch interpreter. GIMP Script-Fu - Basic Scheme. Text and images Copyright (C) 2002 Dov Grobgeld and may not be used without permission of the author.

GIMP Script-Fu - Basic Scheme

Editor's note: since this tutorial was published, the old GIMP Script-Fu interpreter (SIOD) has been replaced by a newer and better one (TinyScheme). GIMP Script-Fu 2 - Basic Scheme2. This article was originally published in Linux Magazine, January 2002.

GIMP Script-Fu 2 - Basic Scheme2

Editor's note: since this tutorial was published, the old GIMP Script-Fu interpreter (SIOD) has been replaced by a newer and better one (TinyScheme). A Script-Fu migration guide is available. Intention Unix (and by association, GNU/Linux) provides the user with an environment full of possibilities. To turn these possibilities into reality, a Unix user must be technical in two senses of the word. Unix is filled with tools that, through an unspoken yet common understanding of the Unix Philosophy, work well with each other.

With that in mind, welcome to our Power Tools column. We begin this month with a look at GIMP. Part of the problem is Scheme, the language used to write scripts for GIMP. The other problem is that the API for GIMP can seem overwhelmingly large at times. A Crash Course in Scheme The first thing people notice when they look at Scheme is all the nested parentheses. Would look like this in Scheme: