xtract.bot
POST /api/gif-to-jpeg

Convert a GIF to a JPEG. Extracts the first frame of the GIF and re-encodes it with mozjpeg. JPEG has no transparency, so transparent GIF pixels are flattened to white (or your chosen background colour).

Takes a GIF and returns its first frame as a JPEG. JPEG doesn't support transparency, so any transparent pixels in the GIF are flattened onto a solid background colour (white by default — adjustable via `background`). If you need to preserve transparency use GIF → PNG instead.

Inputs

NameTypeDefaultDescription
gif*fileInput GIF.
qualitynumber (1…100)80JPEG quality (1–100).
backgroundstring"#ffffff"Background colour for transparent pixels, as #RRGGBB.

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-jpeg \
  -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"'"
}'