2025-03-14 21:59:59 -06:00
|
|
|
# gifsicle
|
|
|
|
|
|
|
|
|
|
> Create, edit, manipulate, and get information about GIF files.
|
|
|
|
|
> More information: <https://www.lcdf.org/gifsicle>.
|
|
|
|
|
|
|
|
|
|
- Optimize a GIF as a new file:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`gifsicle {{path/to/input.gif}} {{[-O|--optimize=]}}3 {{[-o|--output]}} {{path/to/output.gif}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
- Use batch mode (modify each given file in place) and unoptimize a GIF:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`gifsicle {{[-b|--batch]}} {{path/to/input.gif}} {{[-U|--unoptimize]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Extract a frame from a GIF:
|
|
|
|
|
|
|
|
|
|
`gifsicle {{path/to/input.gif}} '#{{0}}' > {{path/to/first_frame.gif}}`
|
|
|
|
|
|
|
|
|
|
- Make a GIF animation from selected GIFs:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`gifsicle {{*.gif}} {{[-d|--delay]}} {{10}} {{[-l|--loop]}} > {{path/to/output.gif}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Reduce file size using lossy compression:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`gifsicle {{[-b|--batch]}} {{path/to/input.gif}} {{[-O|--optimize=]}}3 --lossy={{100}} {{[-k|--colors]}} {{16}} {{[-f|--dither]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Delete the first 10 frames and all frames after frame 20 from a GIF:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`gifsicle {{[-b|--batch]}} {{path/to/input.gif}} --delete '#{{0-9}}' '#{{20-}}'`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Modify all frames by cropping them to a rectangle, changing their scale, flipping them, and rotating them:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`gifsicle {{[-b|--batch]}} --crop {{starting_x}},{{starting_y}}+{{rect_width}}x{{rect_height}} --scale {{0.25}} --flip-horizontal --rotate-{{90|180|270}} {{path/to/input.gif}}`
|