Someone off-list suggested ImageMagick. Some googling shows this command:
convert mulitple.tif single%d.tif
I think this will create multiple files, each representing a page from the
Since I planned on wrapping all my script-fu in PowerShell, I could insert a
call to imagemagick to create a temp folder of split-up TIFs, which my
script-fu could convert to XCF.
I'd rather do the whole thing in script-fu, as I anticipate doing some
filtering and stuff via GIMP.
If I start down the ImageMagick route, I may just go with a
PowerShell/ImageMagick approach and leave out the script-fu.
Any strong suggestions on going one way or the other? I'll still do all my
manual editing in GIMP, but maybe not any of the batch work ...
On Sun, Jun 6, 2010 at 11:03 AM, Dillon <dillonontheco...@gmail.com> wrote:
> Thanks Saulgoode, that worked! It solved both of my problems.
> Interesting. I'll have to puzzle through why it worked later, but now I'm
> on to my next challenge.
> The reason I'm writing my own script-fu, rather than using Daves Batch
> Processor, is that my TIF files are multi-page, and when I load the image
> and flatten it to a drawable, I end up with both pages flattened into one
> drawable. I only want one of the pages (I think the first).
> I need to find a way to select that page (which I assume is turned into a
> layer when the TIF is loaded), and just set that layer to be my drawable.
> Here's the script, as it's currently written (ignore the commented out
> lines - I don't have any version control available to me, so this file is
> full of notes):
> (define (batch-save-as-xcf pattern)
> (let* (
> (filelist (cadr (file-glob pattern 1)))
> (gimp-message-set-handler 2)
> (gimp-message "Preparing to act on the following files")
> (gimp-message pattern)
> (while (pair? filelist)
> ; set filename to the name of the current file in the glob
> (set! filename (car filelist))
> (gimp-message "The current file is: ")
> (gimp-message filename)
> ; set xcfname by tokenizing on "." and taking everything but the last
> (set! fileparts (strbreakup filename "."))
> (set! fileparts (butlast fileparts))
> (set! xcfname (string-append (unbreakupstr fileparts ".") ".xcf"))
> (gimp-message "The new filename will be: ")
> (gimp-message xcfname)
> ; set image from the file, and then get the first layer and set it to
> (gimp-message "Loading File.")
> (set! newimage (car (gimp-file-load RUN-NONINTERACTIVE filename
> ;(set! image (car (file-tiff-load RUN-NONINTERACTIVE filename
> ;(set! newimage (car (gimp-image-get-layers image)))
> ; set drawable to the newimage
> (gimp-message "Setting the Drawable.")
> (set! drawable (car (gimp-image-flatten newimage)))
> ; save the drawable from newimage as xcfname
> (gimp-message "Saving the new file.")
> (gimp-file-save RUN-NONINTERACTIVE newimage drawable xcfname xcfname)
> ;(gimp-image-delete image)
> ;(gimp-image-delete newimage)
> (set! filelist (cdr filelist))
Gimp-user mailing list