Browse Docs
Archives (14)
Audio (38)
Documents (26)
Ebooks (7)
Fonts (13)
Images (62)
Video (10)
On This Page

RAW to AVIF

Convert RAW camera photos to AVIF images.

Try ARW to AVIF in the browser →

Convert.FAST uses this same API — what you see in the browser is what you get in code.

Quick reference

Job typeimage.raw-to-avif
targetFormatavif
Categoryimages
Input formats.cr2, .cr3, .crw, .nef, .nrw, .arw, .sr2, .srf, .raf, .dng, .rw2, .raw, .orf, .pef, .3fr, .fff, .iiq, .srw, .x3f, .gpr, .mrw, .dcr, .kdc, .erf, .mef, .mos
Output extension.avif
Costing1 credit per 5 MB
Max file size1 GB

Example

cURL
# 1) Submit
JOB_ID=$(curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "file=@photo.cr2" \
  -F "targetFormat=avif" | jq -r '.id')
# → 202 Accepted: {"id": "019e3a7b-...", "status": "Queued"}

# 2) Poll until terminal status
while true; do
  RESPONSE=$(curl -sS "https://api.tools.fast/convert/job/${JOB_ID}" \
    -H "X-Fast-Api-Key: $API_KEY")
  STATUS=$(echo "$RESPONSE" | jq -r '.status')
  [ "${STATUS}" = "Succeeded" ] && break
  [ "${STATUS}" = "Failed" ] || [ "${STATUS}" = "Canceled" ] && { echo "$RESPONSE" | jq; exit 1; }
  sleep 1
done

# 3) Download
curl -sS "https://api.tools.fast/convert/job/${JOB_ID}/download" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -o "photo.avif"
# → Binary file (image/avif, 2.5 MB)

With options

cURL
JOB_ID=$(curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "file=@photo.cr2" \
  -F "targetFormat=avif" \
  -F 'options={"resize":{"enabled":false,"mode":"pixels","preset":"off","value":0}}' | jq -r '.id')

Options

This converter supports the following options. See Options Reference for full details.

OptionDescriptionDefault
resizeResize image by pixels or percentage with presets (4K, 1080p, 720p, custom)enabled: false, preset: off
smartCompressionOptimize file size using format-specific compression (MozJPEG, pngquant, etc.)enabled: false
metadataEXIF/GPS metadata handling for privacy and file size reductionstrip: true

Cost estimate

cURL
curl -sS "https://api.tools.fast/convert/estimate/cr2/avif?fileSizeMb=50"
Copied.