1GIFSICLE(1) General Commands Manual GIFSICLE(1)
2
3
4
6 gifsicle - manipulates GIF images and animations
7
9 gifsicle [options, frames, and filenames]...
10
12 gifsicle creates, edits, manipulates, and prints information about GIF
13 images and animations.
14
15 Gifsicle normally processes input GIF files according to its command
16 line options and writes the result to the standard output. The -i op‐
17 tion, for example, tells gifsicle to interlace its inputs:
18
19 gifsicle -i < pic.gif > interlaced-pic.gif
20
21 By default, gifsicle combines two or more input files into a “flipbook”
22 animation:
23
24 gifsicle pic1.gif pic2.gif pic3.gif > animation.gif
25
26 Use options like --delay, --loopcount, and --optimize to tune your ani‐
27 mations.
28
29 To modify GIF files in place, use the --batch option. With --batch,
30 gifsicle will modify the files you specify instead of writing a new
31 file to the standard output. To interlace all the GIFs in the current
32 directory, you could say:
33
34 gifsicle --batch -i *.gif
35
36 New users may want to skip to the Examples section at the end.
37
39 Concepts are on the left, relevant gifsicle options are on the right.
40
41 Animations, changing frame selections, frame changes, etc.
42 disposal --disposal
43 looping --loopcount
44 portions of frame selections
45 smaller --optimize, --colors, --lossy
46 speed --delay
47 Bad output --careful
48 Background color --background
49 Colors, changing --change-color, --use-colormap, --dither,
50 --transform-colormap
51 reducing number --colors, --dither, --gamma
52 Comments --comment
53 Extensions --extension, --app-extension, --extension-info
54 File size --optimize, --unoptimize, --colors, --lossy
55 Image transformations
56 cropping --crop, --crop-transparency
57 flipping --flip-*
58 resizing --resize, --scale
59 rotating --rotate-*
60 Grayscale --use-colormap
61 Interlacing --interlace
62 Positioning frames --position
63 Screen, logical --logical-screen
64 Selecting frames frame selections (like '#0')
65 Transparency --transparent
66 Warnings --no-warnings
67
69 gifsicle's command line consists of GIF input files and options. Most
70 options start with a dash (-) or plus (+); frame selections, a kind of
71 option, start with a number sign (#). Anything else is a GIF input
72 file.
73
74 gifsicle reads and processes GIF input files in order. If no GIF input
75 file is given, or you give the special filename ‘-’, it reads from the
76 standard input.
77
78 gifsicle exits with status 0 if there were no errors and status 1 oth‐
79 erwise.
80
82 Every option has a long form, ‘--long-descriptive-name’. You don't
83 need to type the whole long descriptive name, just enough to make it
84 unambiguous.
85
86 Some options also have a short form, ‘-X’. You can combine short op‐
87 tions if they don't take arguments: ‘-IIb’ is the same as ‘-I -I -b’.
88 But be careful with options that do take arguments: ‘-cblah’ means ‘-c
89 blah’, not ‘-c -b -l -a -h’.
90
91 Many options also have a converse, ‘--no-option’, which turns off the
92 option. You can turn off a short option ‘-X’ by saying ‘+X’ instead.
93
94 Mode Options
95 Mode options tell gifsicle what kind of output to generate. There can
96 be at most one, and it must precede any GIF inputs.
97
98 --merge, -m
99 Combine all GIF inputs into one file with multiple frames and
100 write that file to the standard output. This is the default mode.
101
102 --batch, -b
103 Modify each GIF input in place by reading and writing to the same
104 filename. (GIFs read from the standard input are written to the
105 standard output.)
106
107 --explode, -e
108 Create an output GIF for each frame of each input file. The output
109 GIFs are named ‘xxx.000’, ‘xxx.001’, and so on, where ‘xxx’ is the
110 name of the input file (or whatever you specified with ‘--output’)
111 and the numeric extension is the frame number.
112
113 --explode-by-name, -E
114 Same as --explode, but write any named frames to files ‘xxx.name’
115 instead of ‘xxx.frame-number’. Frames are named using the
116 ‘--name’ option.
117
118 General Options
119 General options control the information gifsicle prints and where it
120 writes its output. The info options and --verbose can be turned off
121 with ‘--no-X’.
122
123 --info, -I
124 Print a human-readable description of each input GIF to the stan‐
125 dard output, or whatever file you specify with -o. This option
126 suppresses normal output, and cannot be combined with mode options
127 like --batch. If you give two --info or -I options, however, in‐
128 formation is printed to standard error, and normal output takes
129 place as usual.
130
131 --color-info, --cinfo
132 Like --info, but also print information about input files' col‐
133 ormaps.
134
135 --extension-info, --xinfo
136 Like --info, but also print any unrecognized GIF extensions in a
137 hexdump(1)-like format.
138
139 --size-info, --sinfo
140 Like --info, but also print information about compressed image
141 sizes.
142
143 --help, -h
144 Print usage information and exit.
145
146 -o file
147 --output file
148 Send output to file. The special filename ‘-’ means the standard
149 output.
150
151 --verbose, -V
152 Print progress information (files read and written) to standard
153 error.
154
155 --no-warnings, -w
156 Suppress all warning messages.
157
158 --no-ignore-errors
159 Exit with status 1 when encountering a very erroneous GIF. Default
160 is to muddle on.
161
162 --version
163 Print the version number and some short non-warranty information
164 and exit.
165
166 --careful
167 Write slightly larger GIFs that avoid bugs in some other GIF im‐
168 plementations. Some Java and Internet Explorer versions cannot
169 display the correct, minimal GIFs that Gifsicle produces. Use the
170 --careful option if you are having problems with a particular im‐
171 age.
172
173 --conserve-memory
174 Conserve memory usage at the expense of processing time. This may
175 be useful if you are processing large GIFs on a computer without
176 very much memory. Or say --no-conserve-memory.
177
178 --nextfile
179 Allow input files to contain multiple concatenated GIF images. If
180 a filename appears multiple times on the command line, gifsicle
181 will read a new image from the file each time. This option can
182 help scripts avoid the need for temporary files. For example, to
183 create an animated GIF with three frames with different delays,
184 you might run "gifsicle --nextfile -d10 - -d20 - -d30 - > out.gif"
185 and write the three GIF images, in sequence, to gifsicle's stan‐
186 dard input.
187
188 --multifile
189 Like --nextfile, but read as many GIF images as possible from each
190 file. This option is intended for scripts. For example, to merge
191 an unknown number of GIF images into a single animation, run "gif‐
192 sicle --multifile - > out.gif" and write the GIF images, in se‐
193 quence, to gifsicle's standard input. Any frame selections apply
194 only to the last file in the concatenation.
195
196 Frame Selections
197 A frame selection tells gifsicle which frames to use from the current
198 input file. They are useful only for animations, as non-animated GIFs
199 only have one frame. Here are the acceptable forms for frame specifica‐
200 tions.
201
202 #num Select frame num. (The first frame is ‘#0’. Negative num‐
203 bers count backwards from the last frame, which is ‘#-1’.)
204 #num1-num2 Select frames num1 through num2.
205 #num1- Select frames num1 through the last frame.
206 #name Select the frame named name.
207
208 The ‘#’ character has special meaning for many shells, so you generally
209 need to quote it.
210
211 For example,
212 gifsicle happy.gif "#0"
213 uses the first frame from happy.gif;
214 gifsicle happy.gif "#0-2"
215 uses its first three frames; and
216 gifsicle happy.gif "#-1-0"
217 uses its frames in reverse order (starting from frame #-1 -- the last
218 frame -- and ending at frame #0 -- the first).
219
220 The action performed with the selected frames depends on the current
221 mode. In merge mode, only the selected frames are merged into the out‐
222 put GIF. In batch mode, only the selected frames are modified; other
223 frames remain unchanged. In explode mode, only the selected frames are
224 exploded into output GIFs.
225
226 Frame Change Options
227 Frame change options insert new frames into an animation or replace or
228 delete frames that already exist. Some things -- for example, changing
229 one frame in an animation -- are difficult to express with frame selec‐
230 tions, but easy with frame changes.
231
232 --delete frames [frames...]
233 Delete frames from the input GIF.
234
235 --insert-before frame other-GIFs
236 Insert other-GIFs before frame in the input GIF.
237
238 --append other-GIFs
239 Append other-GIFs to the input GIF.
240
241 --replace frames other-GIFs
242 Replace frames from the input GIF with other-GIFs.
243
244 --done
245 Complete the current set of frame changes.
246
247 The frames arguments are frame selections (see above). These arguments
248 always refer to frames from the original input GIF. So, if ‘a.gif’ has
249 3 frames and ‘b.gif’ has one, this command
250 gifsicle a.gif --delete "#0" --replace "#2" b.gif
251 will produce an output animation with 2 frames: ‘a.gif’ frame 1, then
252 ‘b.gif’.
253
254 The other-GIFs arguments are any number of GIF input files and frame
255 selections. These images are combined in merge mode and added to the
256 input GIF. The other-GIFs last until the next frame change option, so
257 this command replaces the first frame of ‘in.gif’ with the merge of
258 ‘a.gif’ and ‘b.gif’:
259 gifsicle -b in.gif --replace "#0" a.gif b.gif
260
261 This command, however, replaces the first frame of ‘in.gif’ with
262 ‘a.gif’ and then processes ‘b.gif’ separately:
263 gifsicle -b in.gif --replace "#0" a.gif --done b.gif
264
265 Warning: You shouldn't use both frame selections and frame changes on
266 the same input GIF.
267
268 Image Options
269 Image options modify input images -- by changing their interlacing,
270 transparency, and cropping, for example. Image options have three
271 forms: ‘--X’, ‘--no-X’, and ‘--same-X’. The ‘--X’ form selects a value
272 for the feature, the ‘--no-X’ form turns off the feature, and the
273 ‘--same-X’ form means that the feature's value is copied from each in‐
274 put. The default is always ‘--same-X’. For example, -back‐
275 ground="#0000FF" sets the background color to blue, --no-background
276 turns the background color off (by setting it to 0), and --same-back‐
277 ground uses input images' existing background colors. You can give each
278 option multiple times; for example,
279 gifsicle -b -O2 -i a.gif --same-interlace b.gif c.gif
280 will make ‘a.gif’ interlaced, but leave ‘b.gif’ and ‘c.gif’ interlaced
281 only if they were already.
282
283 -B color
284 --background color
285 Set the output GIF's background to color. The argument can have
286 the same forms as in the --transparent option below.
287
288 --crop x1,y1-x2,y2
289 --crop x1,y1+widthxheight
290 Crop the following input frames to a smaller rectangular area. The
291 top-left corner of this rectangle is (x1,y1); you can give either
292 the lower-right corner, (x2,y2), or the width and height of the
293 rectangle. In the x1,y1+widthxheight form, width and height can be
294 zero or negative. A zero dimension means the cropping area goes to
295 the edge of the image; a negative dimension brings the cropping
296 area that many pixels back from the image edge. For example,
297 --crop 2,2+-2x-2 will shave 2 pixels off each side of the input
298 image. Cropping takes place before any rotation, flipping, resiz‐
299 ing, or positioning.
300
301 --crop-transparency
302 Crop any transparent borders off the following input frames. This
303 happens after any cropping due to the --crop option. It works on
304 the raw input images; for example, any transparency options have
305 not yet been applied.
306
307 --flip-horizontal
308 --flip-vertical
309 Flip the following frames horizontally or vertically.
310
311 -i
312 --interlace
313 Turn interlacing on.
314
315 -S widthxheight
316 --logical-screen widthxheight
317 Set the output logical screen to widthxheight. --no-logi‐
318 cal-screen sets the output logical screen to the size of the
319 largest output frame, while --same-logical-screen sets the output
320 logical screen to the largest input logical screen. --screen is a
321 synonym for --logical-screen.
322
323 -p x,y
324 --position x,y
325 Set the following frames' positions to (x,y). --no-position means
326 --position 0,0. Normally, --position x,y places every succeeding
327 frame exactly at x,y. However, if an entire animation is input,
328 x,y is treated as the position for the animation.
329
330 --rotate-90
331 --rotate-180
332 --rotate-270
333 Rotate the following frames by 90, 180, or 270 degrees. --no-ro‐
334 tate turns off any rotation.
335
336 -t color
337 --transparent color
338 Make color transparent in the following frames. Color can be a
339 colormap index (0-255), a hexadecimal color specification (like
340 "#FF00FF" for magenta), or slash- or comma-separated red, green
341 and blue values (each between 0 and 255).
342
343 Extension Options
344 Extension options add non-visual information to the output GIF. This
345 includes names, comments, and generic extensions.
346
347 --app-extension app-name extension
348 Add an application extension named app-name and with the value ex‐
349 tension to the output GIF. --no-app-extensions removes applica‐
350 tion extensions from the input images.
351
352 -c text
353 --comment text
354 Add a comment, text, to the output GIF. The comment will be placed
355 before the next frame in the stream. --no-comments removes com‐
356 ments from the input images.
357
358 --extension number extension
359 Add an extension numbered number and with the value extension to
360 the output GIF. Number can be in decimal, octal, hex, or it can
361 be a single character like ‘n’, whose ASCII value is used.
362 --no-extensions (or +x) removes extensions from the input images.
363
364 -n text
365 --name text
366 Set the next frame's name to text. This name is stored as an ex‐
367 tension in the output GIF (extension number 0xCE, followed by the
368 characters of the frame name). --no-names removes name extensions
369 from the input images.
370
371 Animation Options
372 Animation options apply to GIF animations, or to individual frames in
373 GIF animations. As with image options, most animation options have
374 three forms, ‘--X’, ‘--no-X’, and ‘--same-X’, and you can give anima‐
375 tion options multiple times; for example,
376 gifsicle -b a.gif -d50 "#0" "#1" -d100 "#2" "#3"
377 sets the delays of frames 0 and 1 to 50, and frames 2 and 3 to 100.
378
379 -d time
380 --delay time
381 Set the delay between frames to time in hundredths of a second.
382
383 -D method
384 --disposal method
385 Set the disposal method for the following frames to method. A
386 frame's disposal method determines how a viewer should remove the
387 frame when it's time to display the next. Method can be a number
388 between 0 and 7 (although only 0 through 3 are generally meaning‐
389 ful), or one of these names: none (leave the frame visible for fu‐
390 ture frames to build upon), asis (same as "none"), background (or
391 bg) (replace the frame with the background), or previous (replace
392 the frame with the area from the previous displayed frame).
393 --no-disposal means --disposal=none.
394
395 -l[count]
396 --loopcount[=count]
397 Set the Netscape loop extension to count. Count is an integer, or
398 forever to loop endlessly. If you supply a --loopcount option
399 without specifying count, Gifsicle will use forever. --no-loop‐
400 count (the default) turns off looping.
401
402 Set the loop count to one less than the number of times you want
403 the animation to run. An animation with --no-loopcount will show
404 every frame once; --loopcount=1 will loop once, thus showing every
405 frame twice; and so forth. Note that --loopcount=0 is equivalent
406 to --loopcount=forever, not --no-loopcount.
407
408 -O[level]
409 --optimize[=level]
410 Attempt to shrink the file sizes of GIF animations. Level deter‐
411 mines how much optimization is done; higher levels take longer,
412 but may have better results. There are currently three levels:
413
414 -O1 Store only the changed portion of each image. This is the de‐
415 fault.
416 -O2 Store only the changed portion of each image, and use trans‐
417 parency.
418 -O3 Try several optimization methods (usually slower, sometimes
419 better results).
420
421 Other optimization flags provide finer-grained control.
422
423 -Okeep-empty
424 Preserve empty transparent frames (they are dropped by de‐
425 fault).
426
427 You may also be interested in other options for shrinking GIFs,
428 such as -k, --lossy, and --no-extensions. Note that -O does not
429 guarantee to shrink file size, and in rare cases, even -O3 may ac‐
430 tually enlarge file size.
431
432 -U
433 --unoptimize
434 Unoptimize GIF animations into an easy-to-edit form.
435
436 GIF animations are often optimized (see --optimize) to make them
437 smaller and faster to load, which unfortunately makes them diffi‐
438 cult to edit. --unoptimize changes optimized input GIFs into un‐
439 optimized GIFs, where each frame is a faithful representation of
440 what a user would see at that point in the animation.
441
442 Image Transformation Options
443 Image transformation options apply to entire GIFs as they are read or
444 written. They can be turned off with ‘--no-option’.
445
446 --resize widthxheight
447 Resize the output GIF to the given width and height. If width or
448 height is an underscore ‘_’, that dimension is chosen so that the
449 aspect ratio remains unchanged. Resizing happens after all input
450 frames have been combined and before optimization. Resizing uses
451 logical screen dimensions; if the input stream has an unusual log‐
452 ical screen (many GIF displayers ignore logical screens), you may
453 want to provide --no-logical-screen (or +S) to reset it so gifsi‐
454 cle uses image dimensions instead. See also --resize-method.
455
456 --resize-width width
457 --resize-height height
458 Resize to a given width or height, preserving aspect ratio. Equiv‐
459 alent to --resize widthx_ or --resize _xheight.
460
461 --resize-fit widthxheight
462 --resize-touch widthxheight
463 Resize the output GIF to fit within a rectangle with dimensions
464 widthxheight. The aspect ratio remains unchanged. The --re‐
465 size-fit option only shrinks the image—no resize is performed if
466 the GIF already fits within the rectangle. Either width or height
467 may be an underscore ‘_’, which leaves that dimension uncon‐
468 strained.
469
470 --resize-fit-width width
471 --resize-fit-height height
472 --resize-touch-width width
473 --resize-touch-height height
474 Like --resize-fit and --resize-touch, but constrains only one di‐
475 mension.
476
477 --scale Xfactor[xYfactor]
478 Scale the output GIF's width and height by Xfactor and Yfactor.
479 If Yfactor is not given, it defaults to Xfactor. Scaling happens
480 after all input frames have been combined and before optimization.
481
482 --resize-method method
483 Set the method used to resize images. The ‘sample’ method runs
484 very quickly, but when shrinking images, it produces noisy re‐
485 sults. The ‘mix’ method is somewhat slower, but produces better-
486 looking results. The default method is currently ‘mix’.
487
488 Details: The resize methods differ most when shrinking images. The
489 ‘sample’ method is a point sampler: each pixel position in the
490 output image maps to exactly one pixel position in the input. When
491 shrinking, full rows and columns from the input are dropped. The
492 other methods use all input pixels, which generally produces bet‐
493 ter-looking images. The ‘box’ method, a box sampler, is faster
494 than the more complex filters and produces somewhat sharper re‐
495 sults, but there will be anomalies when shrinking images by a
496 small amount in one dimension. (Some output pixels will corre‐
497 spond to exactly 1 input row or column, while others will corre‐
498 spond to exactly 2 input rows or columns.) The ‘mix’ method is a
499 full bilinear interpolator. This is slower and produces somewhat
500 blurrier results, but avoids anomalies.
501
502 Gifsicle also supports more complex resamplers, including Catmull-
503 Rom cubic resampling (‘catrom’), the Mitchell-Netravali filter
504 (‘mitchell’), a 2-lobed Lanczos filter (‘lanczos2’), and a 3-lobed
505 Lanczos filter (‘lanczos3’). These filters are slower still, but
506 can give sharper, better results.
507
508 --resize-colors n
509 Allow Gifsicle to add intermediate colors when resizing images.
510 Normally, Gifsicle's resize algorithms use input images' color
511 palettes without changes. When shrinking images with very few col‐
512 ors (e.g., pure black-and-white images), adding intermediate col‐
513 ors can improve the results. Example: --resize-colors 64 allows
514 Gifsicle to add intermediate colors for images that have fewer
515 than 64 input colors.
516
517 Color Options
518 Color options apply to entire GIFs as they are read or written. They
519 can be turned off with ‘--no-option’.
520
521 -k num
522 --colors num
523 Reduce the number of distinct colors in each output GIF to num or
524 less. Num must be between 2 and 256. This can be used to shrink
525 output GIFs or eliminate any local color tables.
526
527 Normally, an adaptive group of colors is chosen from the existing
528 color table. You can affect this process with the --color-method
529 option or by giving your own colormap with --use-colormap. Gifsi‐
530 cle may need to add an additional color (making num+1 in all) if
531 there is transparency in the image.
532
533 --color-method method
534 Determine how a smaller colormap is chosen. ‘diversity’, the de‐
535 fault, is xv(1)'s diversity algorithm, which uses a strict subset
536 of the existing colors and generally produces good results.
537 ‘blend-diversity’ is a modification of this: some color values are
538 blended from groups of existing colors. ‘median-cut’ is the medi‐
539 an cut algorithm described by Heckbert. --method is a synonym for
540 --color-method.
541
542 -f
543 --dither[=method]
544 When --dither is on and the colormap is changed, combinations of
545 colors are used to approximate missing colors. This looks better,
546 but makes bigger files and can cause animation artifacts, so it is
547 off by default.
548
549 Specify a dithering algorithm with the optional method argument.
550 The default, ‘floyd-steinberg’, uses Floyd-Steinberg error diffu‐
551 sion. This usually looks best, but can cause animation artifacts,
552 because dithering choices will vary from frame to frame. Gifsicle
553 also supports ordered dithering algorithms that avoid animation
554 artifacts. The ‘ro64’ mode uses a large, random-looking pattern
555 and generally produces good results. The ‘o3’, ‘o4’, and ‘o8’
556 modes use smaller, more regular patterns. The ‘ordered’ mode
557 chooses a good ordered dithering algorithm. For special effects,
558 try the halftone modes ‘halftone’, ‘squarehalftone’, and ‘diago‐
559 nal’. Some modes take optional parameters using commas. The half‐
560 tone modes take a cell size and a color limit: ‘halftone,10,3’
561 creates 10-pixel wide halftone cells where each cell uses up to 3
562 colors.
563
564 --gamma gamma
565 Set the gamma correction to gamma, which can be a real number or
566 ‘srgb’. Roughly speaking, higher numbers exaggerate shadows and
567 lower numbers exaggerate highlights. The default is the function
568 defined by the standard sRGB color space, which usually works
569 well. (Its effects are similar to --gamma=2.2.) Gifsicle uses gam‐
570 ma correction when choosing a color palette (--colors) and when
571 dithering (--dither).
572
573 --lossy[=lossiness]
574 Alter image colors to shrink output file size at the cost of arti‐
575 facts and noise. Lossiness determines how many artifacts are al‐
576 lowed; higher values can result in smaller file sizes, but cause
577 more artifacts. The default lossiness is 20.
578
579 --change-color color1 color2
580 Change color1 to color2 in the following input GIFs. (The color
581 arguments have the same forms as in the -t option.) Change multi‐
582 ple colors by giving the option multiple times. Color changes
583 don't interfere with one another, so you can safely swap two col‐
584 ors with ‘--change-color color1 color2 --change-color color2 col‐
585 or1’. They all take effect as an input GIF is read.
586 --no-change-color cancels all color changes.
587
588 --transform-colormap command
589 Command should be a shell command that reads from standard input
590 and writes to standard output. Each colormap in the output GIF is
591 translated into text colormap format (see --use-colormap below)
592 and piped to the command. The output that command generates (which
593 should also be in text colormap format) will replace the input
594 colormap. The replacement doesn't consider color matching, so pix‐
595 els that used color slot n in the input will still use color slot
596 n in the output.
597
598 --use-colormap colormap
599 Change the image to use colormap. Each pixel in the image is
600 changed to the closest match in colormap (or, if --dither is on,
601 to a dithered combination of colors in colormap). Colormap can be
602 web for the 216-color “Web-safe palette”; gray for grayscale; bw
603 for black-and-white; or the name of a file. That file should ei‐
604 ther be a text file (the format is described below) or a GIF file,
605 whose global colormap will be used. If --colors=N is also given,
606 an N-sized subset of colormap will be used.
607
608 Text colormap files use this format:
609
610 ; each non-comment line represents one color, "red green blue"
611 ; each component should be between 0 and 255
612 0 0 0 ; like this
613 255 255 255
614 ; or use web hex notation
615 #ffffff ; like this
617 First, let's create an animation, ‘anim.gif’:
618
619 gifsicle a.gif b.gif c.gif d.gif > anim.gif
620
621 This animation will move very quickly: since we didn't specify a delay,
622 a browser will cycle through the frames as fast as it can. Let's slow
623 it down and pause .5 seconds between frames, using the --delay option.
624
625 gifsicle --delay 50 a.gif b.gif c.gif d.gif > anim.gif
626
627 If we also want the GIF to loop three times, we can use --loopcount:
628
629 gifsicle -d 50 --loop=3 a.gif b.gif c.gif d.gif > anim.gif
630
631 (Rather than type --delay again, we used its short form, -d. Many op‐
632 tions have short forms; you can see them by running ‘gifsicle --help’.
633 We also abbreviated --loopcount to --loop, which is OK since no other
634 option starts with ‘loop’.)
635
636 To explode ‘anim.gif’ into its component frames:
637
638 gifsicle --explode anim.gif
639 ls anim.gif*
640 anim.gif anim.gif.000 anim.gif.001 anim.gif.002 anim.gif.003
641
642 To optimize ‘anim.gif’:
643
644 gifsicle -b -O2 anim.gif
645
646 To change the second frame of ‘anim.gif’ to ‘x.gif’:
647
648 gifsicle -b --unoptimize -O2 anim.gif --replace "#1" x.gif
649
650 --unoptimize is used since ‘anim.gif’ was optimized in the last step.
651 Editing individual frames in optimized GIFs is dangerous without --un‐
652 optimize; frames following the changed frame could be corrupted by the
653 change. Of course, this might be what you want.
654
655 Note that --unoptimize and --optimize can be on simultaneously. --un‐
656 optimize affects input GIF files, while --optimize affects output GIF
657 files.
658
659 To print information about the first and fourth frames of ‘anim.gif’:
660
661 gifsicle -I "#0" "#3" < anim.gif
662
663 To make black the transparent color in all the GIFs in the current di‐
664 rectory, and also print information about each:
665
666 gifsicle -bII --trans "#000000" *.gif
667
668 Giving -I twice forces normal output to occur. With only one -I, the
669 GIFs would not be modified.
670
671 To change ‘anim.gif’ to use a 64-color subset of the Web-safe palette:
672
673 gifsicle -b --colors=64 --use-col=web anim.gif
674
675 To make a dithered black-and-white version of ‘anim.gif’:
676
677 gifsicle --dither --use-col=bw anim.gif > anim-bw.gif
678
679 To overlay one GIF atop another -- producing a one-frame output GIF
680 that looks like the superposition of the two inputs -- use gifsicle
681 twice:
682
683 gifsicle bottom.gif top.gif | gifsicle -U "#1" > result.gif
684
686 Some optimized output GIFs may appear incorrectly on some GIF implemen‐
687 tations (for example, Java's); see the --careful option.
688
689 Please email suggestions, additions, patches and bugs to
690 ekohler@gmail.com.
691
693 For a tutorial on GIF images and animations, you might try some of the
694 resources listed on-line at webreference.com:
695 http://www.webreference.com/authoring/graphics/animation.html
696
698 Eddie Kohler <ekohler@gmail.com>
699 http://www.read.seas.harvard.edu/~kohler/
700 He wrote it.
701
702 Anne Dudfield <annied@frii.com>
703 http://www.frii.com/~annied/
704 She named it.
705
706 Hans Dinsen-Hansen <dino@danbbs.dk>
707 http://www.danbbs.dk/~dino/
708 Adaptive tree method for GIF writing.
709
710 Kornel Lesinski
711 --lossy option.
712
713 http://www.lcdf.org/gifsicle/
714 The gifsicle home page.
715
716
717
718Version 1.94 11 July 2017 GIFSICLE(1)