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

Convert a GIF to a PNG. Extracts the first frame of the GIF and re-encodes it as a single PNG (PNG can't store animation; use GIF → APNG if you need that).

Takes a GIF and returns its first frame as a PNG. GIF transparency is preserved (PNG supports an alpha channel), so the output is identical to what the GIF looks like at time = 0. PNG can't store animation. If you want the animation preserved use GIF → APNG (multi-frame PNG) or GIF → animated WebP instead.

Inputs

NameTypeDefaultDescription
gif*fileInput GIF.

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