Make gif

From gupsammy/Claudest · View interactive version

Make gif is an AI agent skill from the GitHub repository gupsammy/Claudest. This skill should be used when the user asks to "make a GIF", "convert to GIF", "create a GIF from this video", "export as GIF", "turn this clip into a GIF", "make an animated GIF", or "gif this".

How to use this skill

Skill file

Video GIF

Convert a video clip to a high-quality GIF using the mandatory 2-pass palette workflow.

Single-pass GIF always produces banding and color artifacts. The palettegen → paletteuse pipeline analyzes the actual clip to build an optimal 256-color palette, then renders with it. Never skip this.

Process

1. Gather parameters

Ask for any not already provided in the request:

If the user asks about aspect ratio or the source has unusual dimensions, probe first:

ffprobe -v quiet -print_format json -show_streams "$INPUT" | \
  python3 -c "import json,sys; s=[s for s in json.load(sys.stdin)['streams'] if s['codec_type']=='video'][0]; print(s['width'], 'x', s['height'])"

2. Build the 2-pass command

Pass 1 — generate optimized palette:

ffmpeg -ss $START -t $DURATION -i "$INPUT" \
  -vf "fps=$FPS,scale=$WIDTH:-1:flags=lanczos,palettegen=stats_mode=full" \
  /tmp/palette_$$.png -y

Pass 2 — render GIF using palette:

ffmpeg -ss $START -t $DURATION -i "$INPUT" -i /tmp/palette_$$.png \
  -lavfi "fps=$FPS,scale=$WIDTH:-1:flags=lanczos [x]; [x][1:v] paletteuse=dither=bayer:bayer_scale=5" \
  "$OUTPUT" -y

Use $$ (shell PID) in the palette temp path to avoid collisions with concurrent runs.

3. Confirm before running

Show the full 2-pass command and estimated output path. Add a size warning if duration × fps is large (rough heuristic: >20s at 15fps at 480px → likely >10MB).

4. Run both passes, then clean up

rm -f /tmp/palette_$$.png

Report output path and file size.

Key Decisions

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.