Simple GIF Animator [SGA]

SGA is a program that allows you to make or edit animated GIF files from GIF files that are created elsewhere.



Contents

  1. Overview of GIF
  2. Overview of SGA
  3. File Menu
  4. Edit Menu
  5. Options Menu
  6. Help Menu
  7. Global Block
  8. Image Block
  9. Comment Block
  10. Application Block
  11. Plaintext Block
  12. Shortcomings of SGA

1. Overview of GIF

GIF stands for Compuserve Interchange Format, and is a graphics format developed by Compuserve and widely used on the Web as well as elsewhere. Licensing, trademark, and other, more complete information is in the GIF Specification, included as gifspec.txt in the source directory for SGA. A GIF file may contain multiple images in compressed form, along with a color table that specifies the colors to be used for the images and additional parameters that affect the display of the image. The compressed image data consist of an index into the color table for each point in the image. There have been two versions of the GIF Specification, GIF87a and GIF89a.

The data in a GIF file may be thought of as blocks, though the specification does not necessarily treat it that way. There is a Global Block that includes the global color table and other parameters that apply to all images. There is an Image Block for each image. These blocks were features of the GIF87a specification. The fact that multiple images were allowed in GIF87a was not widely noticed, and many GIF89a decoders only handle the first image. The GIF89a specification added Extension Blocks (Control, Application, Comment, and Plaintext). The Control Block provides additional data for the image, such as the Transparent Index and Disposal Method. In SGA, the control block is not displayed separately, but is included in the Image Block, so you will not see a Control Block, but it may be there. There is an Application Block that is a general-purpose block that can specify any information that the application it is intended for can understand. SGA only allows you to delete these blocks. You cannot change them. The Comment Block allows you to store a comment in the file. The Plaintext block is a means of specifying text and a way to render it. SGA only allows you to delete Plaintext blocks. You cannot change them.

2. Overview of SGA

SGA is primarily intended as a means of making animated GIF files for MEDM. It is not a drawing program and will not make the images themselves. On UNIX you can capture screens with Xv to make GIF images, and there is a program, GIMP, that is free, has excellent drawing capabilities, and saves images to GIF files. On Windows, there are any number of programs to capture screens, draw, and, in fact, animate GIFs. SGA does allow you to combine GIF files, reorganize them, and change many GIF parameters, including editing the color table.

Most of the use of SGA should be intuitive. Making an animated GIF is not that hard.

The usage for SGA is:

sga <filename>

where <filename> is optional and is the name of a GIF file.

The SGA interface consists of four main areas. At the top left below the menu bar there is the Block List scrolled window. This area shows a list of all the blocks in the current file. To the right of the Block List is the Display Area. This area shows the appropriate information for the currently selected block in the Block List. There are two modes for this display, Image and Data, selectable in the Options Menu. See the Options Menu|Display Mode for a more complete description.

Below the List and Display Areas is the Control Area. It consists of Play, Stop, First, Next, Prev, and Last buttons. You can go to specific frames in the GIF or see it in animation with these buttons. The operation should be obvious.

Below the Control Area is the Option Area. This area shows the options for the currently-selected block that you can change and allows you to change them. The options are discussed under the section for the appropriate block.

The main problem with combining GIF files is the fact that their color tables may differ. There are four modes for combining color tables. See the Options menu for details. You may also start with a GIF with no images but a specified color table by using File|New. There are choices on the Options Menu for color tables of all the available sizes. See the Options Menu section for more information.

SGA should work on both 8-bit and 24-bit displays. Since GIFs may, and often do, contain 256 colors, you may have trouble allocating all the colors on your 8-bit X display. This means the colors will appear to be black, but they will be entered correctly in the file when it is saved. If you are using an 8-bit display, consider trimming the color table. SGA allows you to do this if it is possible.

There is no undo. As with voting in Chicago, save early and often.

Please do not redistribute SGA outside of the EPICS community.

If you have problems, comments, or questions about SGA, you can send them to evans@aps.anl.gov. If you wish to report a bug, it is essential that you send enough information for the bug to be reproduced. It would be helpful to include the SGA version number, the circumstances in which the problem occurs, and an explicit list of steps to duplicate the problem. A copy of the GIF file or how it can be found is helpful. The resources available for technical support of SGA are extremely limited. Please try hard to resolve problems yourself first and to prepare a complete and thought-out problem report otherwise.

3. File Menu

Note that all menus are tear-off. The File Menu contains the following items:

New

Open...

Save

Save As...

Quit

These are standard operations. New is used in conjunction with Options|Default Color Table to make a new GIF with only a specified color table. You can then merge other files into that color table. See Options|Color Table Merge Mode.

4. Edit menu

The Edit Menu contains the following items:

Insert

Delete

Move Up

Move Down

Insert allows you to insert either another GIF file or a Comment Block. The Options|Color Table Merge Mode determines how the color table in the inserted file is combined with the existing color table. The other options do what they say on the selected block in the Block List.

5. Options Menu

The Options Menu contains the following items:

Display Mode

Background

Default Color Table

Color Table merge Mode

The Display Mode is either Image or Data. The Data mode is primarily for debugging. It shows the bytes of the original file, along with other information. The Image mode shows the image for an Image Block and appropriate data for the other blocks. Some of this data is technical and you will have to be familiar with the GIF Specification to understand it. Hopefully, what you need to understand is covered in this help. The GIF Specification is included as gifspec.txt in the directory with the source code for SGA as a source for the other information. You should little cause to use Data Mode.

The Background may be GIF Background, White, or Black. It is the color you see surrounding the image (unless the image is very large, in which case nothing surrounds it) and when the image is offset. The Background Color Index is specified in the Global Block. You may change it when the Global Block is displayed. The GIF Specification says the background shall be this background color. In SGA you have two other choices, White and Black.

The Default Color Table specifies which of the default color tables will be used with File|New. There is a table for each of the allowable color-table sizes (a power of 2). The color tables in these files are fixed, but you may edit them and save them (as GIFs with no images), then open them instead of using File|New to get a color table of your own choices. The 64-color default table has 64 of the 65 MEDM colors. The other default color tables represent the author's idea of a general-purpose set of colors.

The Color Table Merge Mode may be Match Existing Colors, Replace Unused Colors, Add To Existing Colors, and Replace Unused, Then Add. It is used when adding new images. Use Match Existing Colors to maintain the current table. SGA will find the closest match to an existing color. Of course, the new image may not look good with those colors, but you can control the color table this way. This mode is the default. Use Replace Unused Colors to maintain the size of the current color table. This mode will fail if there are not enough unused colors to hold the used colors in the new image. Use Add To Existing Colors to expand the current color table and add each of the used colors in the new image to end of the color table. This mode will fail if the number of colors required exceeds 256, the maximum size for a GIF color table. Use Replace Unused, Then Add to do as well as can be done in merging two tables without changing any colors in either. In all the last three cases unused colors in the new image are not transferred to the current color table. In the Global Block, you can trim the color table to eliminate unused colors to help in inserting images.

6. Help Menu

The Help Menu contains the following items:

Overview

Version

The overview displays this text. If you want a written manual, select the text and copy it to a place where it can be printed. The Version displays the version of SGA.

7. Global Block

The Global Block allows you to specify the Background Color Index, the Logical Screen Width, and the Logical Screen Height. You can also edit the color table, trim the color table, and show the unused colors. The Background Color Index is discussed under Options|Background. The Logical Screen Width and Height represent the overall size of the area in which the images appear. Individual images may be smaller and they may be offset from the top left. They must fit in the overall area though. You can change these Logical Screen values to make them larger than required. Currently there is no means of cropping images to allow them to be made smaller.

The Edit Color Table button brings up a dialog box that shows the entire color table and allows you to edit the RGB values of the colors that go with a given index in the color table. You may leave this dialog box up when opening files, inserting images, or trimming the color table to see what happens. Click on a color to change its RGB values and use the sliders or text entries to change the values. You should see both the old and the new color. The file is not changed until you push Apply.

The Display Area for the Global Block contains additional information from the GIF file or from the X Display. Some of this information is technical and you should not need to know what it means. If you are interested, look at the GIF Specification in gifspec.txt in the source directory, or read an X Windows manual, such as the O'Reilly books. It is beyond the scope of this help.

8. Image Block

The Image Block allows you to change the Transparent Index, the Delay Time, the Left offset, the Top Offset, and the Disposal Method. It also allows you to set whether Transparent Color, Interlacing, or a Local Color Table is used for this image.

The Transparent Index is the index in the color table that will be treated as transparent by the decoder, provided Transparent Color is selected. The Delay Time is the time in 100'ths of a second that this image will stay on the screen before advancing to the next image. The Left and Top Offsets are the number of pixels that this image will be offset from the top left corner. The Disposal Method is how this image will be drawn over the previous image. The possible values are selectable from a menu. The decoder should, but may not honor this. An Image may have its own color table instead of using the global one. SGA does not currently support this. In an interlaced file, sections over the entire image are drawn as they are received, rather than drawing from top to bottom. This allows you to see what the image is about before it is all there. It is not useful in MEDM but should be used if the image is to be displayed in a browser.

There is a toggle button, Apply To All Images, that sets whether the changes you make to this image are applied to all the other images as well or not.

9. Comment Block

The Comment Block contains a text entry that allows you to modify the comment. The comment is not stored until you use the Apply button. You can add a Comment Block via Edit|Insert|Comment.

10. Application Block

Application Blocks are general-purpose blocks that are used by applications that understand them. See the GIF overview above or the GIF Specification for more information. SGA does not allow you to do anything with Application Blocks except delete them.

11. Plaintext Block

Plaintext Blocks are a means of specifying text and a way to render it. SGA does not allow you to do anything with Plaintext Blocks except delete them.

12. Shortcomings of SGA

The following shortcomings may be fixed in the future.

  1. SGA does not handle local color maps in the Image Block.
  2. SGA does not implement the Application Block that specifies a Loop Count. The default is to loop forever. You can copy in a GIF file that has this block if you like. If the Application Block Identifier is NETSCAPE, the Application Authentication Code is 2.0, and the first data byte is 01, then it is a Loop Count block. The next two bytes represent the count.
  3. SGA specifies the Color Table Sort Flag in a Global Block as 0, and does not sort the color table. It specifies the User Input Flag in a Control Block as 0.
  4. SGA does not have an option for a private color map. Editing on an 8-bit display may be a problem because of the lack of colors. Even if the colors cannot be allocated because your X color table is full, the colors should be correct in the GIF and should show up when used on a display with sufficient colors. There should be no problems on a 24-bit display.
  5. SGA does not allow cropping images in order to reduce the Logical Screen Width and/or Height.

Modified September 1, 1999

Maintained by Ken Evans (evans@aps.anl.gov)