2014-02-18 20:11:24 +00:00
|
|
|
# gifsicle
|
|
|
|
|
2024-02-13 13:05:43 +00:00
|
|
|
> Create, edit, manipulate, and get information about GIF files.
|
2019-06-07 11:58:24 +01:00
|
|
|
> More information: <https://www.lcdf.org/gifsicle>.
|
2014-02-18 20:11:24 +00:00
|
|
|
|
2022-08-30 20:49:03 +01:00
|
|
|
- Optimize a GIF as a new file:
|
2018-07-05 16:27:52 +01:00
|
|
|
|
2022-08-30 20:49:03 +01:00
|
|
|
`gifsicle {{path/to/input.gif}} --optimize=3 -o {{path/to/output.gif}}`
|
2018-07-05 16:27:52 +01:00
|
|
|
|
2024-02-13 13:05:43 +00:00
|
|
|
- Use [b]atch mode (modify each given file in place) and unoptimize a GIF:
|
2014-02-18 20:11:24 +00:00
|
|
|
|
2022-08-30 20:49:03 +01:00
|
|
|
`gifsicle -b {{path/to/input.gif}} --unoptimize`
|
2014-02-18 20:11:24 +00:00
|
|
|
|
2022-08-30 20:49:03 +01:00
|
|
|
- Extract a frame from a GIF:
|
2014-02-18 20:11:24 +00:00
|
|
|
|
2024-02-13 13:05:43 +00:00
|
|
|
`gifsicle {{path/to/input.gif}} '#{{0}}' > {{path/to/first_frame.gif}}`
|
2014-02-18 20:11:24 +00:00
|
|
|
|
2022-08-30 20:49:03 +01:00
|
|
|
- Make a GIF animation from selected GIFs:
|
2014-02-18 20:11:24 +00:00
|
|
|
|
2022-08-30 20:49:03 +01:00
|
|
|
`gifsicle {{*.gif}} --delay={{10}} --loop > {{path/to/output.gif}}`
|
|
|
|
|
|
|
|
- Reduce file size using lossy compression:
|
|
|
|
|
|
|
|
`gifsicle -b {{path/to/input.gif}} --optimize=3 --lossy={{100}} --colors={{16}} --dither`
|
|
|
|
|
|
|
|
- Delete the first 10 frames and all frames after frame 20 from a GIF:
|
|
|
|
|
|
|
|
`gifsicle -b {{path/to/input.gif}} --delete '#{{0-9}}' '#{{20-}}'`
|
|
|
|
|
2024-02-13 13:05:43 +00:00
|
|
|
- Modify all frames by cropping them to a rectangle, changing their scale, flipping them, and rotating them:
|
2022-08-30 20:49:03 +01:00
|
|
|
|
2024-02-13 13:05:43 +00:00
|
|
|
`gifsicle -b --crop {{starting_x}},{{starting_y}}+{{rect_width}}x{{rect_height}} --scale {{0.25}} --flip-horizontal --rotate-{{90|180|270}} {{path/to/input.gif}}`
|