xtract.bot
POST /api/image-info

Inspect an image: format, dimensions, colour space, channel count, alpha presence, file size. Cheap and fast — no full decode of the pixel data.

Returns basic information about an image without decoding all of its pixel data: - Format (PNG / JPEG / WebP / GIF / TIFF / AVIF / etc.). - Pixel dimensions (width × height). - Colour space and channel count. - Alpha presence. - File size and approximate decoded RAM footprint. Cheap and fast — useful as a sanity check before triggering an expensive operation.

Inputs

NameTypeDefaultDescription
image*filePNG, JPEG, WebP, or GIF.

Response

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

Code samples

Built from the png-tile example.

# Download or substitute the example input:
#   curl -O https://xtract.bot/examples/image-png-to-webp/sample.png
IMAGE=$(base64 -w0 < sample.png)

curl -X POST https://api.xtract.bot/api/image-info \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "image": "'"$IMAGE"'"
}'