![]() | ![]() | ![]() |
Requires: nothing special (please, don't ask me where you can get them :))
Placement: <Toolbox>/Xtns/Script-Fu/Utils/Load Sequence,
<Image>/File/Save Sequence
File Sequence script is a piece of code which simplifies tedious task of loading dozens of images to Gimp and eventually combining them into one multi-layer image, or saving all layers in image to different files. I have originally developed it to ease the work with POV-Ray rendered animated scenes, but it can be used for any numbered images.
When POV-Ray renders a dynamic scene, it creates a sequence of numbered images,
e.g. room001.tga, room002.tga, ... room150.tga
. To load these
images into Gimp with sequence-file script, it is sufficient to specify
a template for names of files to load and numbers of first and last frame.
If the images should be combined into one image, the template for
layer names has to be specified too.
Similarly, when saving all layers in an image to distinctive files, it is needed to specify template for file names, number of first and last layer (Layers are counted from bottom to top, 1 being the first. If 0 is specified as a last frame, all remaining frames are saved), whether original image size is preserved (not working yet) and whether layer backgrounds are preserved.
Unfortunately, the rather annoying restriction is that GIMP must be
able to deduce image file format --- usually from filename extension --- so
it means that files named e.g. file.001, file.002, ...
will probably
pose a problem.
The importance of this script is smaller in 1.1 versions of GIMP, as the GIMP can load multiple images at once now (shift/ctrl + click in file list). However, combining into single image, etc remain useful still.
|
|
The template is specified as a string, which must contain one or more consecutive characters '%' (percent sign), or one or more consecutive digits (if no '%' is present). The first occurrence is replaced during the loading or saving with an actual frame number. If '%'s are replaced, numbering starts with specified First Frame number; otherwise it starts with the replaced number. It is therefore easy to have files numbered starting with, say 52, and the resulting layers to be numbered starting from 1 and vice versa.
If the replacement is shorter than the number of consecutive '%'s (or digits), it is left-padded with zeros.
Some examples:
First Frame = 1
"pict59.tga" ==> "pict59.tga", "pict60.tga", ...
"pict%%.tga" ==> "pict01.tga", "pict02.tga", ...
"Layer %" ==> "Layer 1", "Layer 2", ..., "Layer 10", ...
"Image 2/%" ==> "Image 2/1", "Image 2/2", ...
Note: When combining images, only the first layer from each image is used, the rest is forgotten.
Note: This version is compatible with GIMP 1.1.22
Grab the source code for Gimp 1.0
![]() | ![]() | ![]() |