Image output formats Last updated: 07. Jul 2026
Docly can deliver modern image formats (WebP / AVIF) with better compression via scaleImage and the site-wide default format.
Docly can deliver modern image formats with better compression. This applies to scaleImage, attachFile64 and the site-wide default (Images.DefaultFormat in site.json).
Available formats
Format | Value | Encoding | Use |
|---|---|---|---|
JPEG |
| GDI+ (fastest) | Standard, universal. |
PNG |
| GDI+ | Lossless / transparency. |
WebP |
| Magick.NET | Better compression than JPEG; universal browser support today. |
AVIF |
| Magick.NET | Best compression; modern browsers. Recommended for the highest performance score (Google's recommendation). |
Auto |
| — | Preserve the source format (PNG → PNG), otherwise JPEG. Falls back to |
How to choose a format
- Per call:
docly.scaleImage(bytes, 1200, 800, 0, 80, "webp")— an explicitformatalways wins.quality(here 80) applies to WebP/AVIF too. - Site default: set
Images.DefaultFormat: "webp"insite.json→ everyscaleImagecall without an explicit format uses WebP.
// explicit AVIF, quality 60
var out = docly.scaleImage(bytes, 800, 600, 0, 60, "avif");
// or a site-wide default in site.json:
{ "Images": { "DefaultFormat": "webp" } } Important limitation (document precisely): WebP/AVIF apply to scaleImage / attachFile64 (and the site default). The URL-based scaling (/photo.jpg/WxHxM/…) delivers JPEG. If you need WebP/AVIF on a link, generate the image with scaleImage and serve/store it yourself. See Image scaling & allowed sizes.