Skip to content

Images and photos

Images are always scanned pages: there is no text layer to read, so every frame goes to the OCR path described in PDFs and scans.

Terminal window
curl https://api.deskew.dev/v1/extract \
-H "Authorization: Bearer $DESKEW_API_KEY" \
-F "file=@receipt.heic" \
-F "output=json"

PNG, JPEG, TIFF, WebP, BMP, GIF, HEIC and HEIF. Detection is by magic bytes, so a .jpg that is really a PNG still works, and HEIC files whose ftyp box is not recognised by generic sniffers are handled explicitly.

Multi-frame files (multi-page TIFF, animated GIF) become one page per frame, up to 200 frames; extra frames are dropped with a warning. Each frame is 4 work units, so a 4-frame TIFF is already an asynchronous job.

  1. The image is converted to RGB and resized so the longer side is at most 2,200 px (tiny images are upscaled so skew correction has something to work with).
  2. A quality report is computed: blur, contrast, skew angle and an overall quality_score in 0–1. It is returned per page.
  3. The page is deskewed by the detected angle.
  4. If the first OCR pass fails validation or has low confidence, the retry runs on an enhanced copy: contrast equalisation (CLAHE), mild denoising and upscaling.

Photos taken at an angle, with uneven lighting or on a phone are the typical case for the retry path. A quality score under 0.45 on a paid plan sends the page straight to the premium engine under quality=auto.

With bbox=true or output=json, blocks on image pages carry a bbox of [x0, y0, x1, y1] normalised to 0–1 of the (deskewed) page. Boxes come from the OCR model and are approximate; they are tagged meta.bbox_source: "vlm-approx". Treat them as good enough for highlighting a region, not for pixel-exact cropping.

Set handwriting=true for handwritten notes and forms. On paid plans the page goes directly to the handwriting model (Pro uses the standard premium model; Scale and Enterprise use the stronger one), for +2 credits per page. On the Free plan the flag is accepted but the page still runs on tier 1 and is flagged if confidence is low.