WebP → AVIF
Try it interactively →POST /api/webp-to-avifConvert WebP to AVIF — typically 20–30% smaller at the same perceptual quality. Configurable quality / encoder effort tradeoff.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| image* | file | — | Input WebP bytes. |
| quality | number (0…100) | 50 | AVIF visual quality 0–100 (50 ≈ JPEG q80). Ignored when lossless=true. |
| effort | number (0…10) | 4 | Encoder effort 0–10. Higher = smaller file, more CPU. |
| lossless | boolean | false | When true, encode losslessly from the decoded WebP pixels. `quality` is ignored. |
Response
Modes: binary, base64-json. Cache: yes (24h TTL).
Code samples
Built from the default example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/image-webp-to-png/sample.webp
IMAGE=$(base64 -w0 < sample.webp)
curl -X POST https://api.xtract.bot/api/webp-to-avif \
-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 '{
"image": "'"$IMAGE"'"
}'