1GIFBUILD(1) GIFLIB Documentation GIFBUILD(1)
2
3
4
6 gifbuild - dump GIF data in a textual format, or undump it to a GIF
7
9 gifbuild [-v] [-a] [-d] [-t translation-table] [-h] [gif-file]
10
12 A program to convert a series of editable text GIF icon specifications
13 and named GIF files into a multi-image GIF, usable as a graphic
14 resource file. It can also dump existing GIFs in this format.
15
16 If no GIF file is given, gifbuild will try to read a text input from
17 stdin.
18
20 Here is a syntax summary in informal BNF. The token `NL' represents a
21 required newline.
22
23 <gif-spec> ::= <header-block> <image-block>...
24
25 <header-block> ::= <header-declaration>...
26
27 <header-declaration ::=
28 | screen width <digits> NL
29 | screen height <digits> NL
30 | screen colors <digits> NL
31 | screen background <digits> NL
32 | pixel aspect byte <digits> NL
33 | screen map <color-table> NL
34
35 <color-table> ::= <color-declaration>... end NL
36
37 <color-declaration> ::= rgb <digits> <digits> <digits> [ is <key>] NL
38 | sort flag {on|off} NL
39
40 <image-block> ::= include <file-name> NL
41 | image NL
42 <image-declaration>...
43 <raster-picture>
44 [ <extension> ]
45
46 <image-declarations> ::= image top <digits> NL
47 | image left <digits> NL
48 | image interlaced NL
49 | image map <color-table> NL
50 | image bits <digits> by <digits> [hex|ascii] NL <raster-block>
51
52 <extension> := <comment> NL <extension-block> NL end NL
53 | <plaintext> NL <extension-block> NL end NL
54 | graphics control NL <GCB-part> NL end NL
55 | netscape loop <digits> NL
56 | extension <hex-digits> NL <extension-block> NL end NL
57
58 <GCB-part> ::= disposal mode <digits> NL
59 | user input flag {on|off} NL
60 | delay <digits> NL
61 | transparent index <digits> NL
62
63
64 If the data types of the “screen height”, “screen width”, “screen
65 background”, “image top”, and “image left” declarations aren't obvious
66 to you, what are you doing with this software?
67
68 The “pixel aspect byte” declaration sets an integer denominator for a
69 fraction expressing the puxel aspect ratio. See the GIF standard for
70 details; this field is actually long obsolete.
71
72 A color table declares color indices (in ascending order from 0) and
73 may associate them with key characters (these associations are absent
74 when the map is more than 94 colors lang and raster blocks using it
75 must use hex pairs). These characters can later be used in raster
76 blocks. As these must be printable and non-whitespace, you can only
77 specify 94 colors per icon. Life is like that sometimes.
78
79 A color table declaration can also set the table's sort flag with "sort
80 flag on" or "sort flag off" on any line before the end.
81
82 An “ascii” raster block is just a block of key characters (used for a
83 color map of 94 or fewer colors). A “hex” raster block uses hex digit
84 pairs instead (used for a color map with more than 94 colors). The
85 default is ASCII. It should be sized correctly for the “image bits”
86 declaration that leads it. Raster blocks from interlaced GIFs are
87 dumped with the lines in non-interlaced order.
88
89 The “comment” or “plaintext” keywords lead defined GIF89 extension
90 record data (the other two GIF89 types, graphics control and
91 application block, are not yet supported). You can also say “extension”
92 followed by a hexadecimal record type. All of these extension
93 declarations must be followed by an extension block, which is
94 terminated by the keyword “end” on its own line.
95
96 An extension block is a series of text lines, each interpreted as a
97 string of bytes to fill an extension block (the terminating newline is
98 stripped). Text may include standard C-style octal and hex escapes
99 preceded by a backslash.
100
101 A graphics control block declaration creates a graphics control
102 extension block; for the field semantics see the GIF89 standard, part
103 23.
104
105 A netscape loop declaration creates an application extension block
106 containing a NETSCAPE 2.0 animation loop control with a specified
107 repeat count (repeat count 0 means loop forever). This must be
108 immediately after the header declaration. These loop blocks are
109 interpreted by the Netscape/Mozilla/Firefox line of browsers.
110
111 All <digits> tokens are interpreted as decimal numerals; <hex-digits>
112 tokens are interpreted as two hex digits (a byte). All coordinates are
113 zero-origin with the top left corner (0,0). Range checking is weak and
114 signedness checking nonexistent; caveat hacker!
115
116 In general, the amount of whitespace and order of declarations within a
117 header or image block is not significant, except that a raster picture
118 must immediately follow its “image bits” bits declaration.
119
120 The “include” declaration includes a named GIF as the next image. The
121 global color maps of included GIFs are merged with the base table
122 defined by any “screen color” declaration. All images of an included
123 multi-image GIF will be included in order.
124
125 Comments may be preceded with “#” and will be ignored.
126
128 -v
129 Verbose mode (show progress). Enables printout of running scan
130 lines.
131
132 -d
133 Dump the input GIF file(s) into the text form described above.
134
135 -t
136 Specify name characters to use when dumping raster blocks. Only
137 valid with -d option.
138
139 -h
140 Print one line of command line help, similar to Usage above.
141
143 Error checking is rudimentary.
144
146 A sample icon file called sample.ico is included in the pic directory
147 of the GIFLIB source distribution.
148
150 Eric S. Raymond <esr@thyrsus.com>
151
152
153
154GIFLIB 2 May 2012 GIFBUILD(1)