BlendGif Manual

From Wiki
Jump to: navigation, search

By Daniel Hellerstein

BlendGIF Options

In addition to this help file, you might find the BlendGIF manual useful

Telling BlendGif what images to use

There are several ways you can tell BlendGif what GIF images to use:

A file on this server.
BlendGif will look in the IMGLIB subdirectory of the special BLENDGIF ROOT directory (which is created by the webmaster) for a file of this name. Example: HELLO.GIF
GET an image from another server.
Enter a fully qualified URL. This should be a URL pointing to GIF file anywhere on the net. BlendGIF will use socket calls to retrieve this image (assuming it's not password protected).Example:
Upload a file from your hard drive.
If you are using a modern browser (NetScape 2.01 and above), you can upload a GIF file from your hard drive. All you have to do is enter it's name (or you can use a BROWSE button) in the Uploading your own GIF files section.
Retrieve the URL of an image that is being displayed in the VIEWER window.
As a visual aide, you can tell the browser to retrieve the URL-string of a GIF file currently being displayed in the VIEWER window. This is a trick that allows you to preview the image you want to "blend", and saves you typing (or cutting and pasting) it's URL. However, due to JavaScript security, you can ONLY retrieve a URL-string that points to this server.

Description of options

Uploading a BlendGIF option file
There are two ways of specifying your animated GIF:
  1. By using the fields on this form to choose options
  2. By uploading a special BlendGIF input file The second option requires that you create an ascii (text) file on your machine, and enter it's name in the Upload load options from a file field. This file should contain a list of option names, and their values.
    For example: INFILE.0=2
    For details on parameter names, please see the BlendGIF manual
The list of GIF images to "blend"
You can specify up to 7 images to "blend". You can also select which "frame", in an animated GIF, to use.
  • you can enter a file name or a URL
  • URLs must start with http://
  • Filenames are relative to this server's () "BlendGif" directory
  • BLENDGIF will use socket calls to retrieve URLS. The content returned from the server must have a content-type response header of image/gif.
  • the file must be a GIF file (BMP, JPEG, etc. will not be read).
  • the size of the animated gif is set by the Size of image option (with possible modifications via the image-specific transformations)
  • Advanced option: Instead of a server-file or a URL, you can upload your own GIF files
Image number
This image number refers to a frame within an animated gif - this option allows you to pluck one of the frames from a pre-existing animated GIF . If the GIF file you wish to use is not an animated GIF, the image number is ignored (since there is only one image to choose from).
Number of times to display the set of images
Iterations should be an integer greater then 0.
Delay between frames
In 1/100th seconds. Thus, a value of 50 means 1/2 second.
Number of frames between each image pair
More frames means smoother transitions, but also means larger files and longer processing time.
Cycle images back to first image
You can create a "cyclical" animated GIF, with the display of intermediate images reversed. This is a nice way of smoothing repeated displays, you avoid discontinuous jumps between the last and first image. Alternatively, one could specify a sequence of images that start with a first image, have the "last" image in the middle, and end with the first image - but that doubles the processing time required.
Setting the size of the image
There are three choices:
Use the size of the first image
Use the maximum height, and maximum width - where the maximum is computed over all images
Specify a width and height The Width and height fields are only used when the Specify a width and height option is chosen (otherwise, they are ignored).

In addition to this automatic size computation, you can specify image-specific transformations.

Attempt to minimize the size of the final GIF file
By default, BlendGIF uses a fairly inefficient method of storing image information: each frame contains a complete image. That is, each frame of the animated GIF "covers" the full width and height of the image. Since in many cases only a fraction of the pixels change between frames, the size of the final image ile can be substantially reduced by using "retain prior image" features of the GIF standard. You can instruct BlendGIF to attempt to shrink the file size (using this retain prior image trick). This requires an additional step, which is attempted after all frames have been computed (hence, it requires additional processing time).
Caution: the results of this "shrinkage" may cause some browsers to crash!
Immediately upload image
After BlendGIF constructs your animated GIF, it can either:
  1. Immediately transfer it to you.
    This requires a browser that suports maintained connections
  2. Do not immediately transfer the image.
    Instead, save it as a temporary file, which you can then obtain (by clicking on a link).
    If you want to save your results, use this option Note that the temporary file will be retained (on this server) for a short time period.
Stop after this many frames
Instead of creating all the frames, stop after you've drawn this many framees. This can create some interesting partial replacements, especially when combined with the cycle-back option. To suppress this trick (that is, to display all the frames), leave this field blank.
Suppress transparency
If selected then either:
none of the images in the animated gif will be "transparent".
The "intermediate" frames will not be transparent
Any frame may be transparent When not explicitly disabled, transparency is based on whether the specified images were transparent. In some cases, transparency seems to cause odd problems, which can be solved by enabling this option.
In other cases, enabling transparency can improve the image (as when trying to add images to pre-existing images).
Set the accuracy of "best fades"
Processing fades requires matching colors determined on the fly to a color in the global color table. To expedite this process, a 3 dimensional index is created. You can set the size of this index - larger values tend to yield smoother fades, but can greatly increase processing time.
The default value (16) seems to be a reasonable compromise between speed and quality.
Image disposal
How to dispose of images. When using automatic resizing this parameter may have little effect. However, when using image-specific transformations, this can have a major impact (on whether prior images are retained or erased).
Colors in merged color table
The length of the "global" color table BlendGif will create a combined color table using all the images you specify. This "global" color table is used to display the intermediate images.
Note that the original images will be displayed with their own "local" color table.
Merge color table by
It's quite possible that the combined number of colors (in the merged color table) is greater then 256 (256 is the maximum number of colors a GIF can use), In such cases, BlendGif will need to pick and choose which colors to use. CT_MAKE_SPEC is used to select from three different methods:
  1. use the most frequent colors
  2. use the most frequent colors, but also use some "average" colors (these are chosen to minimize the "distance" of all colors in all images to the closest color in the global color table.
  3. similar to 2, but create more of the "average" colors. Method 1 is fastest, but may do a bad job of displaying infrequently used colors. Methods 2 and 3 provide some insurance against this problem, but are slower.
Background colors
These values are used for pixel 0. This color is used when you've selected no resizing of images, and an image is smaller then a user specified height and width. Note that Pixel 0 is displayed when transparency is turned off. You should enter a value between 0 and 255 (inclusive) -- where 0 is "no color" and 255 is "maxiumum brightness".

Description of animation-types

Several types of blending (animation types) are supported, each of which can be further modified using one or several parameters.

In the following descriptions, first and second image refers to images in an image-pair

ADD The second image is added on top of the first image.
Intermediate frames are not created -- the second image simply is placed on top of the first image.

If you want to retain portions of the first image, so as to "sequentially build" a final image, you can:

  1. Use transformed images
  2. use images that have a lot of transparent pixels, in connjunction with the do not suppress transparency and the retain disposal options.
  3. Special Note: You can create a moving-series of images (across a constant background) by using a series of values for when specifying image-specific transformations
BALLOON The first image is replaced by an expanding "balloon" of the second image.

Four balloon types are recognized:

  1. SQUARE: A square balloon
  2. DIAMOND: A diamond balloon
  3. OCTAGON: An octagon balloon
  4. CIRCLE: A circular balloon.

Three overwrite modes are available:

  1. OVERWRITE: second image overwrites first image
  2. PUSH: second image "pushes" first image "off the screen".
  3. SQUOOSH: second image "squooshes" the first image "into oblivion".
CURTAIN The second image is a curtain pulled over the first image
  • Two fractions (between 0 and 1) are used locate the center of the balloon.
  • There are three choices for which direction to draw the curtain:
    • Top to bottom
    • Left to right
    • Two curtains converging in the middle (from left and right)

Three overwrite modes are available:

  1. OVERWRITE: second image overwrites first image
  2. PUSH: second image "pushes" first image "off the screen"
  3. SQUOOSH: second image "squooshes" first image "into oblivion"

The first image dissolves into the second image

DISSOLVE works by randomly replacing image1 pixels with image2 pixels; with latter frames containing a greater proportion of image2 pixels.

You can customize the speed of the dissolve by modifying the dissolve speed. This parameter should contain a space delimited list of integers between 0 (0 percent-- use image 1 pixels) to 100 (100 percent -- use image 2 pixels). These values are used to create a graph, with each frames "dissolve threshold" read from the graph.


  • 1 = a linear ramp (starting from 0 to 100)
  • 1 10 80 90 = start with a slow change, a quick jump, ending with a slow change
FADE The first image fades into the second image.

There are several ways of specifying a fade:

  • Frequency sorted color table. Fast, but not very pretty
  • Brightness sorted color table. Fast, and can be nice for fairly similar images.
  • Color specific brightness sort. Similar to above, but several different "sets of colors" are sorted, which can improve the smoothness of the fade.
  • Best match. Each pixel of each image is assigned a unique color, which is then mapped to the closest matching color in the global color table. This usually produces nicest fades, but can be slow to compute.
  • string. A string containing a math expression that uses the R G and B variables, to specify a color table sort.

For example: 2*R + G would create fades from the darkest red to brightest red, with green counting somewhat (and blue not considered).

MASK "Mask" files are used to overlay portions of the second image onto the first image.

If a pixel value in a mask file pixel value is greater then 0, then the corresponding pixel in image 1 (the one at the same row and column position) is replaced with the corresponding image 2 pixel.

Note that the mask files are either replicated or clipped to assure that their size corresponds to the size of the first image.

Advanced options

Advanced options: Grabbing a URL from the VIEWER window

As an aid to us lazy folks, you can use the VIEWER window to search for images, and then tell BlendGif to use them. With one large exception, this is easily done by:

  1. Opening up a [javascript:reset_viewer() VIEWER window]
  2. Using everyday browser features (such as right-mouse-button on an embedded GIF image), view a GIF in this VIEWER window (not the document in which the GIF is embedded -- you must view the GIF itself)
  3. Click the appropriate grab from viewer window button.

But there is that crucial caution: the images you grab must be on this server (). If not, JavaSript security may kick in, and shutdown your browser.

Advanced options: Layering images (on top of prior images)

When BlendGIF creates an animated GIF, it's usual mode of operation is to completely replace one image with a new image; where this new image is either an "intermediate" frame, or the next image you specified. In cases where one wants to "layer" images (that is, to paste new images on top of previous images), BlendGIF's usual mode is inappropriate.

However, the ADD animation type, in combination with image-specific transformations, can be used to create layered images.

  • You'll need to specify the same image file (or URL) for several images, and then select your desired image-specific transformations (say, successively larger rightward shifts).
  • When you specify multiple values in one of the image-specific transformation fields, the images are non-cumulative. However, they are layered on top of the prior image, and the last frame in such a series will be retained.
  • You probably should specify an explicit image size greater then the images you are layering

You can also achieve some "layering" effects by:

  • using the stop-after and the # of frames parameter equal to 1, and use image-specific transformations.
  • It's a bit of a hack, but if your images have a lot of "transparent" pixels, you can select Do NOT suppress transparency and select the retain disposal option