xtract.bot

GIF → animated WebP

Try it interactively →
POST /api/gif-to-webp

Convert an animated GIF to an animated WebP. Lossy by default for smaller files; switch on lossless mode to preserve pixels exactly. Loop count and quality are configurable.

Re-encodes an animated GIF as an animated WebP. Each GIF frame is composited (handling GIF's disposal modes), encoded with libwebp, and packed into a standard animated WebP container so any modern browser plays it. Animated WebP typically beats GIF on both size and quality for photographic content. For tiny palette animations the size advantage is smaller — toggle `lossless: true` if you need pixel-exact output.

Inputs

NameTypeDefaultDescription
gif*fileInput animated GIF.
qualitynumber (1…100)75WebP quality (1–100). Ignored when lossless=true.
losslessbooleanfalseEncode losslessly. Preserves pixels exactly; larger output.
loopCountnumber (0…65535)0How many times to loop. 0 = infinite (the GIF default).

Response

Modes: binary, json. Cache: yes (24h TTL).

Code samples

Built from the dog example.

# Download or substitute the example input:
#   curl -O https://xtract.bot/examples/gif-extract-frames/dog.gif
GIF=$(base64 -w0 < dog.gif)

curl -X POST https://api.xtract.bot/api/gif-to-webp \
  -H "Content-Type: application/json" \
  -H "Accept: application/octet-stream" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "gif": "'"$GIF"'"
}'