The way I use Gimp and other tools is by creating files and then importing them into another program. For example on my current project the file from my customer was a pdf of an older version of his book. with type blue in color. To get a file with black text and change the running heads to the new title I burst the pdf file into individual pages using pdftk. Then I imported each page pdf into gimp and used gimp tools to clip the edges and change the text color to black.This is easy in gimp. I saved this page file as a pdf file. If the file needed further editing such as fancy artwork I did this in scribus and again saved as pdf. I reassembled the pages into a single pdf via the Context version of TeX (Scribus can't handle large numbers of pages in a single file at reasonable speed yet).
This is the 'nix way of doing work. Trying to write code to move data in a special format from one program to another via subprogram calls is too much work. Exporting a file from one program and importing it into another using a standardized file layout like pdf or svg or in some cases plain ASCII text simplifies the workflow and puts less burden on each program. -- John Culleton Wexford Press Book layout, typesetting and Indexing Free list of books for self-publishers: http://wexfordpress.net/shortlist.html
