-
Notifications
You must be signed in to change notification settings - Fork 240
/
gifsicle.1
1348 lines (1339 loc) · 32 KB
/
gifsicle.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.\" -*- mode: nroff -*-
.AM
.ds V 1.95
.ds E " \-\-
.if t .ds E \(em
.de Op
.BR "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
..
.de Oa
.IR "\fB\\$1\& \|\fI\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
..
.de Qo
.RB \(oq "\\$1" "\(cq\\$2"
..
.de Qa
.BI "\fR\(oq\fB\\$1" " \\$2" " \\$3" " \\$4" "\fR\(cq\\$5"
..
.de Sp
.if n .sp
.if t .sp 0.4
..
.de Ix
.TP 25
\\$1
.nh
\\$2
.hy
..
.de Es
.Sp
.RS 5
.nf
..
.de Ee
.fi
.RE
.PP
..
.de Xs
.RS 5
.nf
..
.de Xe
.fi
.RE
..
.TH GIFSICLE 1 "11 July 2017" "Version \*V"
.SH NAME
gifsicle \- manipulates GIF images and animations
.SH SYNOPSIS
.B gifsicle
\%[options, frames, and filenames].\|.\|.
'
.SH DESCRIPTION
.B gifsicle
creates, edits, manipulates, and
prints information about GIF images and animations.
.PP
.B Gifsicle
normally processes input GIF files according to its command line
options and writes the result to the standard output. The
.Op \-i
option, for example, tells
.B gifsicle
to interlace its inputs:
.Es
\fBgifsicle \-i < pic.gif > interlaced-pic.gif\fR
.Ee
.PP
By default,
.B gifsicle
combines two or more input files into a \(lqflipbook\(rq animation:
.Es
\fBgifsicle pic1.gif pic2.gif pic3.gif > animation.gif\fR
.Ee
Use options like
.Op \-\-delay ", " \-\-loopcount ", and " \-\-optimize
to tune your animations.
.PP
To modify GIF files in place, use the
.Op \-\-batch
option. With
.Op \-\-batch ,
.B gifsicle
will modify the files you specify instead of writing a new file to the
standard output. To interlace all the GIFs in the current directory, you
could say:
.Es
\fBgifsicle \-\-batch \-i *.gif
.Ee
.PP
New users may want to skip to
the Examples section at the end.
'
.SH CONCEPT INDEX
'
Concepts are on the left, relevant
.B gifsicle
options are on the right.
'
.Sp
.PD 0
.Ix "Animations, changing" "frame selections, frame changes, etc."
.Ix "\ \ \ disposal" "\fB\-\-disposal\fP"
.Ix "\ \ \ looping" "\fB\-\-loopcount\fP"
.Ix "\ \ \ portions of" "frame selections"
.Ix "\ \ \ smaller" "\fB\-\-optimize\fP, \fB\-\-colors\fP, \fB\-\-lossy\fP"
.Ix "\ \ \ speed" "\fB\-\-delay\fP"
.Ix "Bad output" "\fB\-\-careful\fP"
.Ix "Background color" "\fB\-\-background\fP"
.Ix "Colors, changing" "\fB\-\-change\-color\fP, \fB\-\-use\-colormap\fP, \fB\-\-dither\fP, \fB\-\-transform\-colormap\fP"
.Ix "\ \ \ reducing number" "\fB\-\-colors\fP, \fB\-\-dither\fP, \fB\-\-gamma\fP"
.Ix "Comments" "\fB\-\-comment\fP"
.Ix "Extensions" "\fB\-\-extension\fP, \fB\-\-app\-extension\fP, \fB\-\-extension\-info\fP"
.Ix "File size" "\fB\-\-optimize\fP, \fB\-\-unoptimize\fP, \fB\-\-colors\fP, \fB\-\-lossy\fP"
.TP 30
Image transformations
.Ix "\ \ \ cropping" "\fB\-\-crop\fP, \fB\-\-crop\-transparency\fP"
.Ix "\ \ \ flipping" "\fB\-\-flip\-*\fP"
.Ix "\ \ \ resizing" "\fB\-\-resize\fP, \fB\-\-scale\fP"
.Ix "\ \ \ rotating" "\fB\-\-rotate\-*\fP"
.Ix "Grayscale" "\fB\-\-use\-colormap\fP"
.Ix "Interlacing" "\fB\-\-interlace\fP"
.Ix "Positioning frames" "\fB\-\-position\fP"
.Ix "Screen, logical" "\fB\-\-logical\-screen\fP"
.Ix "Selecting frames" "frame selections (like \fB'#0'\fP)"
.Ix "Transparency" "\fB\-\-transparent\fP"
.Ix "Warnings" "\fB\-\-no\-warnings\fP"
.PD
'
.SH COMMAND LINE
.BR gifsicle 's
command line consists of GIF input files and options. Most options start
with a dash (\-) or plus (+); frame selections, a kind of option, start
with a number sign (#). Anything else is a GIF input file.
.PP
.B gifsicle
reads and processes GIF input files in order. If no GIF input file is
given, or you give the special filename \(oq\-\(cq,
it reads from the standard input.
.PP
.B gifsicle
exits with status 0 if there were no errors and status 1 otherwise.
'
.SH OPTIONS
Every option has a long form,
.Qo \-\-long\-descriptive\-name .
You don't need to type the whole long descriptive name, just enough to
make it unambiguous.
.PP
Some options also have a short form,
.Qo \-X .
You can combine short options if they don't take arguments:
.Qo \-IIb
is the same as
.Qo "\-I \-I \-b" .
But be careful with options that do take arguments:
.Qo \-cblah
means
.Qo "\-c \fRblah" ,
not
.Qo "\-c \-b \-l \-a \-h" .
.PP
Many options also have a converse,
.Qo \-\-no\-option ,
which turns off the option. You can turn off a short option
.Qo \-X
by saying
.Qo \+X
instead.
'
.\" -----------------------------------------------------------------
.SS Mode Options
Mode options tell
.B gifsicle
what kind of output to generate. There can be at most one, and it must
precede any GIF inputs.
.TP 5
.Op "\-\-merge" ", " "\-m"
'
Combine all GIF inputs into one file with multiple frames and write that
file to the standard output. This is the default mode.
'
.TP
.Op \-\-batch ", " \-b
'
Modify each GIF input in place by reading and writing to the same filename.
(GIFs read from the standard input are written to the standard output.)
'
.TP
.Op \-\-explode ", " \-e
'
Create an output GIF for each frame of each input file. The output GIFs are
named \(oqxxx.000\(cq, \(oqxxx.001\(cq, and so on, where \(oqxxx\(cq is the name of the input
file (or whatever you specified with
.Qo \-\-output )
and the numeric extension is the frame number.
'
.TP
.Op \-\-explode\-by\-name ", " \-E
'
Same as
.Op \-\-explode ","
but write any named frames to files \(oqxxx.\fIname\fR\(cq instead of
\(oqxxx.\fIframe-number\fR\(cq. Frames are named using the
.Qo \-\-name
option.
'
.\" -----------------------------------------------------------------
.SS General Options
General options control the information
.B gifsicle
prints and where it writes its output. The info options and
.Op \-\-verbose
can be turned off with
.Qo \-\-no\-X .
'
.Sp
.PD 0
.TP 5
.Op \-\-info ", " \-I
'
Print a human-readable description of each input GIF to the standard
output, or whatever file you specify with
.Op \-o .
This option suppresses normal output, and cannot be combined with mode
options like
.Op \-\-batch .
If you give two
.Op \-\-info
or
.Op \-I
options, however, information is printed to standard error, and normal
output takes place as usual.
'
.Sp
.TP 5
.Op \-\-color\-info ", " \-\-cinfo
'
Like
.Op \%\-\-info ,
but also print information about input files' colormaps.
'
.Sp
.TP 5
.Op \-\-extension\-info ", " \-\-xinfo
'
Like
.Op \%\-\-info ,
but also print any unrecognized GIF extensions in a
.BR hexdump (1)-like
format.
'
.Sp
.TP 5
.Op \-\-size\-info ", " \-\-sinfo
'
Like
.Op \%\-\-info ,
but also print information about compressed image sizes.
'
.Sp
.TP 5
.Op \-\-help ", " \-h
'
Print usage information and exit.
'
.Sp
.TP
.Oa \-o file
.TP
.Oa \-\-output file
'
Send output to
.IR file .
The special filename \(oq-\(cq means the standard output.
'
.Sp
.TP
.Op \-\-verbose ", " \-V
'
Print progress information (files read and written) to standard
error.
'
.Sp
.TP
.Op \-\-no\-warnings ", " \-w
'
Suppress all warning messages.
'
.Sp
.TP
.Op \-\-no\-ignore\-errors
'
Exit with status 1 when encountering a very erroneous GIF. Default is to
muddle on.
'
.Sp
.TP
.Op \-\-version
'
Print the version number and some short non-warranty information and exit.
'
.Sp
.PD 0
.TP 5
.Op \-\-careful
'
Write slightly larger GIFs that avoid bugs in some other GIF
implementations. Some Java and Internet Explorer versions cannot display
the correct, minimal GIFs that Gifsicle produces. Use the
.Op \-\-careful
option if you are having problems with a particular image.
'
.Sp
.TP
.Op \-\-conserve\-memory
'
Conserve memory usage at the expense of processing time. This may be useful
if you are processing large GIFs on a computer without very much memory. Or
say
.Op \-\-no\-conserve\-memory .
'
.Sp
.TP
.Op \-\-nextfile
'
Allow input files to contain multiple concatenated GIF images. If a
filename appears multiple times on the command line, \fBgifsicle\fR will
read a new image from the file each time. This option can help scripts
avoid the need for temporary files. For example, to create an animated GIF
with three frames with different delays, you might run "\fBgifsicle
\-\-nextfile \-d10 \- \-d20 \- \-d30 \- > out.gif\fR" and write the three
GIF images, in sequence, to \fBgifsicle\fR's standard input.
'
.Sp
.TP
.Op \-\-multifile
'
Like
.Op \-\-nextfile ,
but read
.I as many GIF images as possible
from each file. This option is intended for scripts. For example, to merge
an unknown number of GIF images into a single animation, run "\fBgifsicle
\-\-multifile \- > out.gif\fR" and write the GIF images, in sequence, to
\fBgifsicle\fR's standard input. Any frame selections apply only to the
last file in the concatenation.
'
.PD
'
.\" -----------------------------------------------------------------
.SS Frame Selections
A frame selection tells
.B gifsicle
which frames to use from the current input file. They are useful only for
animations, as non-animated GIFs only have one frame. Here are the
acceptable forms for frame specifications.
.Sp
.PD 0
.TP 13
.BI # num
'
Select frame \fInum\fR. (The first frame is
.Qo #0 .
Negative numbers count backwards from the last frame, which is
.Qo #-1 .)
'
.TP 13
.BI # num1 \- num2
'
Select frames \fInum1\fR through \fInum2\fR.
'
.TP 13
.BI # num1 \-
'
Select frames \fInum1\fR through the last frame.
'
.TP 13
.BI # name
'
Select the frame named \fIname\fR.
.PD
.PP
The \(oq#\(cq character has special meaning for many shells, so you generally
need to quote it.
.PP
For example,
.Xs
\fBgifsicle happy.gif "#0"\fR
.Xe
uses the first frame from happy.gif;
.Xs
\fBgifsicle happy.gif "#0-2"\fR
.Xe
uses its first three frames; and
.Xs
\fBgifsicle happy.gif "#-1-0"\fR
.Xe
uses its frames in reverse order (starting from frame #-1\*Ethe
last frame\*Eand ending at frame #0\*Ethe first).
.PP
The action performed with the selected frames depends on the current
mode. In merge mode, only the selected frames are merged into the output
GIF. In batch mode, only the selected frames are modified; other frames
remain unchanged. In explode mode, only the selected frames are exploded
into output GIFs.
'
.\" -----------------------------------------------------------------
.SS Frame Change Options
Frame change options insert new frames into an animation or replace or
delete frames that already exist. Some things\*Efor example, changing one
frame in an animation\*Eare difficult to express with frame selections, but
easy with frame changes.
'
.TP 5
.Oa \-\-delete frames " [" frames ".\|.\|.]"
'
Delete
.I frames
from the input GIF.
'
.TP
.Oa \-\-insert\-before "frame other-GIFs"
'
Insert
.I other-GIFs
before
.I frame
in the input GIF.
'
.TP
.Oa \-\-append "other-GIFs"
'
Append
.I other-GIFs
to the input GIF.
'
.TP
.Oa \-\-replace "frames other-GIFs"
'
Replace
.I frames
from the input GIF with
.IR other-GIFs .
'
.TP
\fB\-\-done\fR
'
Complete the current set of frame changes.
'
.PP
The
.I frames
arguments are frame selections (see above). These arguments always refer to
frames from the
.I original
input GIF. So, if \(oqa.gif\(cq has 3 frames and \(oqb.gif\(cq has one, this
command
.Xs
\fBgifsicle a.gif \-\-delete "#0" \-\-replace "#2" b.gif\fR
.Xe
will produce an output animation with 2 frames: \(oqa.gif\(cq frame 1, then
\(oqb.gif\(cq.
.PP
The
.I other-GIFs
arguments are any number of GIF input files and frame selections.
These images are combined in merge mode and added to the input GIF.
The
.I other-GIFs
last until the next frame change option, so this command replaces the
first frame of \(oqin.gif\(cq with the merge of \(oqa.gif\(cq and \(oqb.gif\(cq:
.Xs
\fBgifsicle \-b in.gif \-\-replace "#0" a.gif b.gif\fR
.Xe
.PP
This command, however, replaces the first frame of \(oqin.gif\(cq with
\(oqa.gif\(cq and then processes \(oqb.gif\(cq separately:
.Xs
\fBgifsicle \-b in.gif \-\-replace "#0" a.gif \-\-done b.gif\fR
.Xe
.PP
Warning: You shouldn't use both frame selections and frame changes on
the same input GIF.
'
.\" -----------------------------------------------------------------
.SS Image Options
Image options modify input images\*Eby changing their interlacing,
transparency, and cropping, for example. Image options have three forms:
.Qo \-\-X ,
.Qo \-\-no\-X ,
and
.Qo \-\-same\-X .
The
.Qo \-\-X
form selects a value for the feature, the
.Qo \-\-no\-X
form turns off the feature, and the
.Qo \-\-same\-X
form means that the feature's value is copied from each input. The default
is always
.Qo \-\-same\-X .
For example,
.Op \-background= """#0000FF"""
sets the background color to blue,
.Op \-\-no\-background
turns the background color off (by setting it to 0), and
.Op \-\-same\-background
uses input images' existing background colors. You can give each option
multiple times; for example,
.Xs
\fBgifsicle \-b \-O2 \-i a.gif \-\-same\-interlace b.gif c.gif\fR
.Xe
will make \(oqa.gif\(cq interlaced, but leave \(oqb.gif\(cq and \(oqc.gif\(cq interlaced only
if they were already.
'
.Sp
.PD 0
.TP 5
.Oa \-B color
.TP
.Oa \-\-background color
'
Set the output GIF's background to
.IR color .
The argument can have the same forms as in the
.Op \-\-transparent
option below.
'
.Sp
.TP
.Oa \-\-crop x1 , y1 - x2\fR,\fIy2
.TP
.Oa \-\-crop x1 , y1 + width\fRx\fIheight
'
Crop the following input frames to a smaller rectangular area. The top-left
corner of this rectangle is
.RI ( x1 , y1 );
you can give either the lower-right corner,
.RI ( x2 , y2 ),
or the width and height of the rectangle. In the
.IR x1 , y1 + width x height
form,
.I width
and
.I height
can be zero or negative. A zero dimension means the cropping area goes to
the edge of the image; a negative dimension brings the cropping area that
many pixels back from the image edge. For example,
.Op \-\-crop " 2,2+-2x-2"
will shave 2 pixels off each side of the input image. Cropping happens
before any rotation, flipping, resizing, or positioning.
'
.Sp
.TP
.Op \-\-crop\-transparency
'
Crop any transparent borders off the following input frames. This happens
after any cropping due to the
.Op \-\-crop
option. It works on the raw input images; for example, any transparency
options have not yet been applied.
'
.Sp
.TP
.Op \-\-flip\-horizontal
.TP
.Op \-\-flip\-vertical
'
Flip the following frames horizontally or vertically.
'
.Sp
.TP
.Op \-i
.TP
.Op \-\-interlace
'
Turn interlacing on.
'
.Sp
.TP
.Oa \-S width x height
.TP
.Oa \-\-logical\-screen width x height
'
Set the output logical screen to
.IR width x height .
.Op \-\-no\-logical\-screen
sets the output logical screen large enough to include all output frames, while
.Op \-\-same\-logical\-screen
sets the output logical screen large enough to include all input logical
screens.
.Op \-\-screen
is a synonym for
.Op \-\-logical\-screen .
'
.Sp
.TP
.Oa \-p x\fR,\fIy
.TP
.Oa \-\-position x\fR,\fIy
'
Set the following frames' positions to
.RI ( x , y ).
.Op \-\-no\-position
means
.Op \-\-position " 0,0."
Normally,
.Oa \-\-position x\fR,\fIy
places every succeeding frame exactly at \fIx\fR,\fIy\fR. However, if an
entire animation is input, \fIx\fR,\fIy\fR is treated as the position for
the animation.
'
.Sp
.TP
.Op \-\-rotate\-90
.TP
.Op \-\-rotate\-180
.TP
.Op \-\-rotate\-270
'
Rotate the following frames by 90, 180, or 270 degrees.
.Op \-\-no\-rotate
turns off any rotation.
'
.Sp
.TP
.Oa \-t color
.TP
.Oa \-\-transparent color
'
Make
.I color
transparent in the following frames.
.I Color
can be a colormap index (0\-255), a hexadecimal color specification
(like "#FF00FF" for magenta), or slash- or comma-separated red, green
and blue values (each between 0 and 255).
.PD
'
.\" -----------------------------------------------------------------
.SS Extension Options
Extension options add non-visual information to the output GIF. This
includes names, comments, and generic extensions.
'
.Sp
.PD 0
.TP 5
.Oa \-\-app\-extension app\-name " " extension
'
Add an application extension named
.I app\-name
and with the value
.I extension
to the output GIF.
.Op \-\-no\-app\-extensions
removes application extensions from the input images.
'
.Sp
.TP
.Oa \-c text
.TP
.Oa \-\-comment text
'
Add a comment,
.IR text ,
to the output GIF. The comment will be placed before the next frame in
the stream.
.Op \-\-no\-comments
removes comments from the input images.
'
.Sp
.TP
.Oa \-\-extension number " " extension
'
Add an extension numbered
.I number
and with the value
.I extension
to the output GIF.
.I Number
can be in decimal, octal, hex, or it can be a single character like \(oqn\(cq,
whose ASCII value is used.
.Op \-\-no\-extensions
(or
.Op +x )
removes extensions from the input images.
'
.Sp
.TP
.Oa \-n text
.TP
.Oa \-\-name text
'
Set the next frame's name to
.IR text .
This name is stored as an extension in the output GIF (extension number
0xCE, followed by the characters of the frame name).
.Op \-\-no\-names
removes name extensions from the input images.
'
.PD
'
.\" -----------------------------------------------------------------
.SS Animation Options
Animation options apply to GIF animations, or to individual frames in GIF
animations. As with image options, most animation options have three forms,
.Qo \-\-X ,
.Qo \-\-no\-X ,
and
.Qo \-\-same\-X ,
and you can give animation options multiple times; for example,
.Xs
\fBgifsicle \-b a.gif \-d50 "#0" "#1" \-d100 "#2" "#3"\fR
.Xe
sets the delays of frames 0 and 1 to 50, and frames 2 and 3 to 100.
'
.Sp
.PD 0
.TP 5
.Oa \-d time
.TP
.Oa \-\-delay time
'
Set the delay between frames to
.IR time
in hundredths of a second.
'
.Sp
.TP
.Oa \-D method
.TP
.Oa \-\-disposal method
'
Set the disposal method for the following frames to
.IR method .
A frame's disposal method determines how a viewer should remove the frame
when it's time to display the next.
.I Method
can be a number between 0 and 7 (although only 0 through 3 are
generally meaningful), or one of these names:
.BR none
(leave the frame visible for future frames to build upon),
.BR asis
(same as "none"),
.BR background " (or " bg ")"
(replace the frame with the background), or
.BR previous
(replace the frame with the area from the previous displayed frame).
.Op \-\-no\-disposal
means
.Op \-\-disposal = none .
'
.Sp
.TP
.Op \-l "[\fIcount\fR]"
.TP
.Op \-\-loopcount "[=\fIcount\fR]"
'
Set the Netscape loop extension to
.IR count .
.I Count
is an integer, or
.B forever
to loop endlessly. If you supply a
.Op \-\-loopcount
option without specifying
.IR count ,
Gifsicle will use
.BR forever .
.Op \-\-no\-loopcount
(the default) turns off looping.
.Sp
Set the loop count to one less than the number of times you want the
animation to run. An animation with
.Op \-\-no\-loopcount
will show every frame once;
.Op \-\-loopcount =1
will loop once, thus showing every frame twice; and so forth.
Note that
.Op \-\-loopcount =0
is equivalent to
.Op \-\-loopcount =forever,
not
.Op \-\-no\-loopcount .
'
.Sp
.TP
.Op \-O "[\fIlevel\fR]"
.TP
.Op \-\-optimize "[=\fIlevel\fR]"
'
Attempt to shrink the file sizes of GIF animations.
.I Level
determines how much optimization is done; higher levels take longer, but
may have better results. There are currently three levels:
.Sp
.RS
.TP 5
.Op \-O1
Store only the changed portion of each image. This is the default.
.TP 5
.Op \-O2
Store only the changed portion of each image, and use transparency.
.TP 5
.Op \-O3
Try several optimization methods (usually slower, sometimes better results).
.Sp
.PP
Other optimization flags provide finer-grained control.
.Sp
.TP 5
.Op \-Okeep-empty
Preserve empty transparent frames (they are dropped by default).
.Sp
.PP
You may also be interested in other options for shrinking GIFs, such as
.Op \-k ,
.Op \-\-lossy ,
and
.Op \-\-no\-extensions .
Note that
.Op \-O
does not guarantee to shrink file size, and in rare cases, even
.Op \-O3
may actually enlarge file size.
.RE
'
.Sp
.TP 5
.Oa \-U
.TP
.Oa \-\-unoptimize
'
Unoptimize GIF animations into an easy-to-edit form.
.Sp
GIF animations are often optimized (see
.Op \-\-optimize )
to make them smaller and faster to load, which unfortunately makes them
difficult to edit.
.Op \-\-unoptimize
changes optimized input GIFs into unoptimized GIFs, where each frame is a
faithful representation of what a user would see at that point in the
animation.
.RE
'
.PD
'
.\" -----------------------------------------------------------------
.SS Image Transformation Options
'
Image transformation options apply to entire GIFs as they are read or
written. They can be turned off with
.Qo \-\-no\-option .
'
.Sp
.PD 0
.TP 5
.Oa \-\-resize width x height
'
Resize the output GIF to the given
.IR width " and " height .
If
.I width
or
.I height
is an underscore \(oq_\(cq, that dimension is chosen so that the
aspect ratio remains unchanged.
Resizing happens after all input frames have been combined and before
optimization. Resizing uses logical screen dimensions; if
the input stream has an unusual logical screen (many GIF displayers ignore
logical screens), you may want to provide
.Op \-\-no\-logical\-screen
(or
.Op +S )
to reset it so
.B gifsicle
uses image dimensions instead. See also
.Op \-\-resize\-method .
'
.Sp
.TP
.Oa \-\-resize\-width width
.TP
.Oa \-\-resize\-height height
'
Resize to a given width or height, preserving aspect ratio. Equivalent to
.Oa \-\-resize width x_
or
.Oa \-\-resize "" _x height .
'
.Sp
.TP
.Oa \-\-resize\-fit width x height
.TP
.Oa \-\-resize\-touch width x height
'
Resize the output GIF to fit within a rectangle with dimensions
.IR width x height .
The aspect ratio remains unchanged. The
.Op \-\-resize\-fit
option only shrinks the image\(emno resize is performed if the GIF already
fits within the rectangle. Either
.I width
or
.I height
may be an underscore \(oq_\(cq, which leaves that dimension unconstrained.
'
.Sp
.TP
.Oa \-\-resize\-fit\-width width
.TP
.Oa \-\-resize\-fit\-height height
.TP
.Oa \-\-resize\-touch\-width width
.TP
.Oa \-\-resize\-touch\-height height
'
Like
.Oa \-\-resize\-fit
and
.Op \-\-resize\-touch ,
but constrains only one dimension.
'
.Sp
.TP
.Oa \-\-scale Xfactor [x Yfactor ]
'
Scale the output GIF's width and height by
.IR Xfactor " and " Yfactor .
If
.I Yfactor
is not given, it defaults to
.IR Xfactor .
Scaling happens after all input frames have been combined and before
optimization.
'
.Sp
.TP
.Oa \-\-resize\-method method
'
Set the method used to resize images. The \(oqsample\(cq method runs
very quickly, but when shrinking images, it produces noisy results.
The \(oqmix\(cq method is somewhat slower, but produces better-looking
results. The default method is
currently \(oqmix\(cq.
.RS
.Sp
.PP
Details: The resize methods differ most when shrinking images. The
\(oqsample\(cq method is a point sampler: each pixel position in the
output image maps to exactly one pixel position in the input. When
shrinking, full rows and columns from the input are dropped. The other
methods use all input pixels, which generally produces better-looking
images. The \(oqbox\(cq method, a box sampler, is faster than the more
complex filters and produces somewhat sharper results, but there will
be anomalies when shrinking images by a small amount in one dimension.
(Some output pixels will correspond to exactly 1 input row or column,
while others will correspond to exactly 2 input rows or columns.) The
\(oqmix\(cq method is a full bilinear interpolator. This is slower and
produces somewhat blurrier results, but avoids anomalies.
.Sp
.PP
Gifsicle also supports more complex resamplers, including
Catmull-Rom cubic resampling (\(oqcatrom\(cq), the Mitchell-Netravali
filter (\(oqmitchell\(cq), a 2-lobed Lanczos filter
(\(oqlanczos2\(cq), and a 3-lobed Lanczos filter (\(oqlanczos3\(cq).
These filters are slower still, but can give sharper, better results.
.RE
'
.Sp
.TP
.Oa \-\-resize\-colors n
'
Allow Gifsicle to add intermediate colors when resizing images.
Normally, Gifsicle's resize algorithms use input images' color
palettes without changes. When shrinking images with very few colors
(e.g., pure black-and-white images), adding intermediate colors can
improve the results. Example:
.Oa \-\-resize\-colors 64
allows Gifsicle to add intermediate colors for images that have fewer
than 64 input colors.
.PD
'
.\" -----------------------------------------------------------------
.SS Color Options
'
Color options apply to entire GIFs as they are read or
written. They can be turned off with
.Qo \-\-no\-option .