AVIF Conversion Blueprint: Best Settings for WebP & JPG
AVIF Conversion & Optimization18 min read

AVIF Conversion Blueprint: Best Settings for WebP & JPG

AVIF has become a go-to source format for modern image pipelines: smaller files, great detail preservation, and efficient animation support. But the real-world task I see every day is not "use AVIF" — it's "convert AVIF into the formats downstream systems actually need," like WebP for web delivery or JPG for email, legacy CMSes, and print-prep. This guide is a practical blueprint for engineers, designers, and photographers who need reliable, repeatable AVIF conversion settings for WebP and JPG that balance quality, file size, color fidelity, and compatibility.

I'll share concrete encoder settings, quality mappings, troubleshooting tips, and workflow patterns I use at Craftle and on AVIF2Anything.com. This post focuses on AVIF conversion settings for WebP and JPG (and related tasks like preserving transparency to PNG or generating print-ready PDF/TIFF) with attention to both technical detail and usable defaults.

Why this blueprint — and what makes AVIF conversions special?

AVIF is an AV1-based image format; it behaves differently from the decades-old DCT-based JPG or the WebP codec family. The differences show up in:

  • How quality maps between codecs. A single “quality=80” setting doesn’t mean the same thing in AVIF, WebP, and JPEG.
  • Color handling. AVIF images are often stored as YUV with high chroma precision and can embed ICC profiles that must be handled correctly to avoid color shifts.
  • Alpha and animation handling. AVIF supports alpha and animations natively, which affects the choice to convert to PNG, WebP, GIF, or keep AVIF animated.
  • Encoder options. AV1-based encoders emphasize quantizer ranges and CPU-heavy compression, while libwebp and mozjpeg offer different speed/quality trade-offs.

Because of these differences, the only reliable approach is to build a conversion blueprint that maps AVIF characteristics to the target format’s settings and to include rules for common edge cases (alpha, animation, print). I’ll walk through those mappings, give recommended settings, and provide command-line examples and workflows you can adapt.

Top-level recommendations at a glance

Here are the quick, practical defaults I use. They’re tuned for production conversion where clarity and predictable visual parity matter more than achieving the absolute smallest file size.

  • AVIF → WebP (lossy, web): Use libwebp's cwebp with -q 85, --preset picture, and -m 6 (multi-thread). For images with alpha, use -lossless 0 and -alpha_q 90 or use lossless when preserving exact alpha is essential.
  • AVIF → JPG (web/email): Use mozjpeg (cjpeg) with -quality 85, -optimize, -progressive, and 4:2:0 chroma subsampling for web; use 4:4:4 or -sampling-factor 1x1 for print master files.
  • AVIF with transparency → PNG: Preserve alpha by converting to PNG with pngquant or zopfli-deflate for smaller lossless files; use -strip metadata only when safe.
  • Animated AVIF → GIF: Use ffmpeg with a palette generation step and dither settings; consider converting animated AVIF to animated WebP instead when browser support and clients allow.
  • Print (AVIF → PDF/TIFF): Convert to high-quality TIFF (48-bit/16-bit when available) or generate a PDF with embedded sRGB/CMYK ICC and 300 DPI; avoid direct lossy JPG for print masters.

Below I’ll unpack why these defaults work, how to tune them, and what to do when things go wrong.

Understanding quality mapping: AVIF to WebP and JPG

The trickiest part of conversion is mapping perceived quality between codecs. AVIF uses AV1 quantizers which control transform coefficients; libavif frontends often present quality via "min/max q" or "quality" sliders that are not linear with JPG/WebP quality scales. WebP and JPG use perceptual quality numbers where higher means better reconstruction, but the same numeric value produces different visual results across codecs.

Guiding principles for mapping quality

  • Perceptual equivalence over numeric parity: visually compare identical crops at candidate settings and choose the smallest setting that preserves your target visual fidelity.
  • Consider content type: photos, screenshots, illustrations, and images with text need different tuning. Screenshots often require higher chroma fidelity and fewer aggressive smoothing artifacts.
  • Start from a high-quality master. If your AVIF is already highly compressed, you may have lost detail that can’t be recovered. Where possible, preserve a high-quality AVIF master or original source.

Below are conservative mapping ranges I use based on tests across varied photographic and graphic content. These ranges are starting points — your content and tolerance for artifacts should guide final values.

Source AVIF quality (libavif slider / subjective) Suggested WebP (cwebp) settings Suggested JPG (mozjpeg/cjpeg) settings Notes / Use cases
High (near visually lossless) -q 90–100, --preset picture, -m 6 -quality 90–95, -optimize, -progressive, sampling 4:4:4 Photography, hero images, large prints — keep more chroma detail
High / Balanced -q 80–90, -m 6, --preset picture -quality 80–90, -optimize, -progressive, sampling 4:2:0 Most web images where quality and file size both matter
Balanced / Small -q 70–80, --preset photo, -m 4 -quality 70–80, -optimize, progressive Thumbnails, social previews where bandwidth is more important
Aggressive small -q 50–70, consider resampling, -m 4 -quality 50–70, chroma 4:2:0, consider additional denoise Very small avatars, inline images where artifacts are acceptable

These ranges are intentionally broad. The perceptual differences between 85 and 90 for WebP may be minor for many photographs but meaningful for fine gradients and tonal ranges.

Recommended command-line recipes

Below are concrete commands I use in automation scripts and batch jobs. They assume you’re starting with an AVIF file and have standard command-line tools installed: ffmpeg, cwebp (from libwebp), mozjpeg (cjpeg), ImageMagick (convert), and optionally libavif tools (avifdec/avifenc) and pngquant.

AVIF → WebP (static, lossy) using cwebp

cwebp -q 85 -preset photo -m 6 -af input.avif -o output.webp

Notes:

  • -q 85: quality 0–100; 85 is a strong default for photos with good size vs quality.
  • -preset photo: tuned for photographic content.
  • -m 6: compression method (0=fastest, 6=slowest/best).
  • -af: auto-filtering; helps on noisy images.

AVIF → WebP (preserve alpha / lossless alpha)

cwebp -q 90 -lossless 0 -alpha_q 95 -preset picture -m 6 input.avif -o output.webp

Use -lossless 1 to create fully lossless WebP if visual fidelity of RGB channels must match exactly, but expect larger files. -alpha_q controls alpha quality; for critical alpha edges use a high value or lossless alpha.

AVIF → JPEG (mozjpeg) for web

cjpeg -quality 85 -optimize -progressive -sample 2x2 -output output.jpg input.png

Notes:

  • Most pipelines decode AVIF to an intermediate PNG/RGB then pass to cjpeg. If you have ImageMagick you can do convert input.avif ppm:- | cjpeg ...
  • -sample 2x2 corresponds to 4:2:0 chroma subsampling; use 1x1 for 4:4:4 if you need full chroma fidelity.

AVIF → JPEG (mozjpeg) for print masters

cjpeg -quality 92 -optimize -progressive -sample 1x1 -restart 8 input.ppm > master.jpg

For print masters prefer quality 92–95 and 4:4:4 chroma (1x1) to avoid color banding. Better yet, export as a high-bit-depth TIFF for color-managed workflows.

AVIF with alpha → PNG (preserve transparency)

magick input.avif -strip -colorspace sRGB png:- | pngquant --quality=80-95 -o output.png -- 

Or a straight lossless export:

magick input.avif -strip -colorspace sRGB output.png

Notes:

  • pngquant reduces PNG size with lossy quantization that preserves visual alpha. Use it when both smaller files and preserved transparency are required.
  • -strip removes metadata when privacy or size are priorities; keep metadata when EXIF matters for workflows.

Animated AVIF → Animated WebP (using ffmpeg)

ffmpeg -i input.avif -c:v libwebp -lossless 0 -q:v 80 -preset default -loop 0 -an output.webp

Notes:

  • ffmpeg supports animated WebP with libwebp. Use -q:v around 70–85 for good compromises.
  • For animated GIF output (legacy), see the troubleshooting section — GIF is larger and limited to 256 colors.

Exact settings explained: why each option matters

Knowing what each encoder option affects helps you make principled adjustments rather than guessing.

WebP

  • -q: controls lossy compression strength (0–100). Higher values preserve detail but increase size.
  • -m: method (0–6) controls encoder effort; higher is slower but usually smaller/better.
  • --preset: picture vs photo vs drawing; choose photo for photos, picture for mixed content, drawing for sharp edges and illustrations.
  • -lossless: toggles fully lossless encoding. Use when exact pixel preservation is necessary; otherwise lossy WebP is often smaller and visually acceptable.
  • -alpha_q: separate alpha quality. Useful to avoid haloing on semi-transparent edges.

JPEG (mozjpeg / cjpeg)

  • -quality: perceptual quality slider (0–100). MozJPEG is optimized for smaller files at the same perceived quality compared to libjpeg-turbo.
  • -sample / -sampling-factor: controls chroma subsampling. 4:2:0 (2x2) is standard for web; 4:4:4 (1x1) keeps full chroma for graphics and print.
  • -optimize: performs Huffman table optimization to reduce file size.
  • -progressive: generates progressive JPEGs that render progressively in slow networks.

Color spaces and ICC

Always normalize to sRGB for web unless you have a color-managed pipeline. AVIF files may contain wider color gamuts (BT.2020) or higher bit-depths. If a conversion pipeline ignores embedded ICC or color primaries, images may shift in hue or brightness. Typical rules:

  • For web: convert to sRGB and 8-bit per channel unless client supports wide-gamut and you want that fidelity. Use ImageMagick’s -colorspace sRGB or explicit ICC transforms.
  • For print: consider converting to the target CMYK ICC profile if the printer requires it, and export at 300 DPI using high-bit-depth TIFF or PDF.

Proper color handling reduces the most common conversion complaint: "my image looks different after conversion."

Choosing JPG vs WebP from AVIF: format-selection guidance

Both formats remain widely used. Choose based on these considerations:

  • Compatibility: JPG is nearly universal; WebP has broad browser support but can be problematic in legacy mail clients or some CMS image processors. Check current support at Can I Use for WebP and AVIF: Can I Use: AVIF.
  • Alpha support: WebP supports alpha; JPG does not. If transparency matters (logos, overlays), avoid JPG unless you flatten into a background.
  • Animation: WebP supports animation; JPG does not. For animated AVIF consider animated WebP as a better target than GIF if clients accept it.
  • Print and legacy workflows: Use JPG or high-bit-depth TIFF/PDF for print. JPG with 4:4:4 sampling and higher quality works for many print pipelines, but TIFF/PDF with embedded ICC is safest.

When preparing images for different platforms, use this short decision tree:

  1. If transparency required → convert AVIF to PNG or WebP (alpha).
  2. If animation required and client supports WebP → convert animated AVIF to animated WebP.
  3. If maximum compatibility required (email, older CMS) → convert to JPG with conservative quality 85–90.
  4. If print or professional color required → convert to TIFF or PDF with ICC and high DPI.

For photographers needing multiple output formats, I recommend retaining a high-quality AVIF or original RAW, then producing WebP for web and JPG/TIFF for print with automated jobs driven by these settings.

Workflows and automation patterns

Batch processing and CI/CD-friendly workflows are where these settings matter most. I’ll outline two common patterns: a web pipeline and a print pipeline.

Web pipeline (CDN uploads / responsive images)

  1. Source ingestion: accept AVIF upload or convert original source to a high-quality AVIF master (quality ~95).
  2. Derive sizes: generate responsive sizes (320, 480, 768, 1024, 1600, etc.). Use gnomic resampling filters (Lanczos) for photos.
  3. Format targets:
    • Primary: AVIF (if client supports) + WebP fallback.
    • Secondary: JPG fallback for email/legacy clients.
  4. Encode with recommended settings: cwebp -q 85 for WebP; mozjpeg -quality 85 for JPG.
  5. Push to CDN with cache-control and content negotiation configured where possible. When using automatic format negotiation, send AVIF, WebP, JPG variants.

When batch processing for web and print, keep the master AVIF and a master TIFF/JPG for print. This avoids repeated lossy transcoding which can accumulate artifacts.

Print pipeline

  1. Start from the highest fidelity source available (RAW or high-bit-depth TIFF). If you only have AVIF, ensure it came from a high-quality encode.
  2. Convert to 16-bit TIFF or high-quality JPG with 4:4:4 chroma and minimal compression (quality 92–95).
  3. Embed the correct ICC profile and convert to the printer’s target CMYK profile if required using a color-managed tool like ImageMagick + LittleCMS or Photoshop.
  4. Package into a PDF with embedded images and ICC profiles for press submission.

For converting AVIF to PDF for print, producing a high-quality TIFF and then packaging in PDF is often the safest path. Examples below show ImageMagick + Ghostscript flows.

magick input.avif -colorspace RGB -depth 16 output.tiff
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf output.tiff

This preserves greater color depth and gives you control over embedding profiles.

Troubleshooting common conversion issues

Converting AVIF to other formats can raise predictable problems. Here are issues I’ve seen and the remedies I apply.

Color shifts, washed-out images

Cause: Missing ICC conversion or the decoder defaulting to a different color primaries/gamut. Fixes:

  • Explicitly convert to sRGB during conversion: ImageMagick -colorspace sRGB or use LittleCMS to convert embedded profiles.
  • Ensure the AVIF decoder used supports color profiles and color primaries; older avifdec/libavif versions may mishandle certain headers.
  • Check for HDR/wide-gamut AVIF; map to SDR properly using tone mapping if needed.

Broken or missing alpha after conversion

Cause: Target format doesn’t support alpha, or conversion tool flattens alpha by default. Fixes:

  • If you need transparency, convert to PNG or WebP (alpha supported). For PNG, ensure you use tools that preserve the alpha channel (magick input.avif output.png).
  • When converting to JPG intentionally, flatten onto a background color: ImageMagick -background white -alpha remove -alpha off.

Banding and posterization

Cause: Excessive quantization or roundtrip between differing bit depths and color spaces. Fixes:

  • Increase target quality (WebP -q, JPG -quality) or export with higher bit-depth intermediates.
  • Apply subtle dithering before quantization (pngquant supports dithering; cwebp has filters)
  • Preserve 10–12 bit depth where possible for heavy-grade tonal images, then downsample carefully for final output.

Large resulting files after conversion

Cause: Choosing lossless settings, incorrect presets, or not resampling large sources. Fixes:

  • Resample images to the required maximum display dimension before encoding.
  • Use appropriate encoder presets (-m for cwebp or libwebp for more time-intensive compression on server side).
  • Compare lossy vs lossless; sometimes lossy + high q produces smaller files than a naive lossless approach.

Animated AVIF conversion producing poor GIFs

GIF is limited to indexed 256-color palettes and can appear blocky; use a two-pass palette generation approach to improve quality. Use ffmpeg commands like:

ffmpeg -i input.avif -vf "fps=15,scale=640:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i input.avif -i palette.png -lavfi "fps=15,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5" output.gif

Or prefer animated WebP where possible; it maintains full color and usually smaller sizes.

Comparison tables for quick reference

The tables below summarize tradeoffs and recommended encoder settings for the common target formats when converting from AVIF.

Target Alpha Animation Best use Recommended settings
WebP (static) Yes (lossy/lossless) Limited (animated WebP) Modern web delivery, alpha-supported UI assets cwebp -q 80–90 -preset photo -m 6; for alpha: -alpha_q 90
JPEG No No Legacy compatibility, email, social sharing (raster photos) mozjpeg cjpeg -quality 85–92 -optimize -progressive -sampling 2x2 (web) or 1x1 (print)
PNG Yes No Logos, images needing perfect transparency magick -strip -colorspace sRGB; pngquant 80-95 for lossy size reduction
GIF Limited Yes Legacy animation support with 256-color restriction ffmpeg palette generation + paletteuse with dithering; expect large sizes

These comparisons help teams select their default targets during conversion runs and inform fallback strategies in responsive image delivery.

Practical tips — things that save time and avoid surprises

  • Keep the AVIF master together with metadata: a well-labeled master reduces guesswork later.
  • Generate visual diffs when tuning quality: 200px zoom crops make it easy to spot blocking or haloing.
  • Use automated A/B visual testing for large batches: spot-check across content types (portraits, landscapes, UI screenshots) rather than relying on a single benchmark image.
  • Profile encoders in CI: encoder versions change behavior; pin tool versions in your build system to avoid silent regressions.
  • Expose a "quality tier" setting in UIs: let content teams choose between “web / social / print” and map those to concrete encoder presets.

If you want a quick, privacy-focused online tool to experiment with conversion presets, I built AVIF2Anything.com, which exposes many of these options in a small UI and keeps no uploaded files. It’s a useful way to validate encoder differences before rolling settings into your automated jobs. You can also integrate similar configuration patterns into your build pipeline using avif2anything as a reference for practical presets.

Troubleshooting checklist (quick)

When conversions don’t look right, run this checklist in order:

  1. Verify the AVIF displays correctly in a modern viewer (browser or dedicated tool).
  2. Check for color profile presence in the AVIF: does it have an ICC? Is it wide gamut?
  3. Confirm the decoder in your pipeline supports the AVIF features (animation, alpha, HDR).
  4. Test conversions with a high-quality baseline (e.g., cwebp -q 95 and cjpeg -quality 95) to see if artifacts are source-encoded.
  5. Adjust chroma sampling and quality settings iteratively and compare cropped regions at 1:1.

If persistent issues remain, consider re-encoding the AVIF into a temporary high-fidelity PNG/TIFF and working from that file so you can isolate encoder behavior.

Additional resources

For deeper reading on browser support, color, and format tradeoffs, these resources are useful and stable:

I also maintain a small public converter that demonstrates these settings in a privacy-first UI: AVIF2Anything.com. Use it to validate presets and experiment quickly without installing tools locally.

FAQ

Below are concise answers to common questions I encounter when implementing AVIF conversion workflows.

Q: What is the easiest way to map AVIF "quality" to a JPG quality value?

A: There’s no exact 1:1 mapping because codecs use different compression models. Practically, I start with AVIF visually equivalent to libwebp -q 85 or JPEG -quality 85–90. If the AVIF is visually lossless, convert to JPEG with quality 90–95 for print masters. For web, 85 is a reliable default. Always validate on sample crops.

Q: Should I ever convert AVIF to PNG instead of JPG or WebP?

A: Yes—when transparency must be preserved or you need lossless output. PNG is also appropriate for images with large flat-color areas (icons, UI components) where JPG artifacts would be visible. For size-sensitive cases with transparency, use PNG quantization tools like pngquant.

Q: Can animated AVIF be safely converted to animated WebP or GIF?

A: Animated WebP is usually the best animated target when client support exists because it preserves full color and typically smaller sizes than GIF. GIF conversion is sometimes necessary for legacy support, but expect larger files and reduced color fidelity. Use ffmpeg with palette generation for best GIF results.

Q: How do I preserve EXIF and orientation metadata when converting?

A: Many encoders strip metadata by default. Use ImageMagick’s -strip option only if you want to remove metadata. Otherwise, use tools that preserve EXIF (exiftool can copy metadata after conversion). Be mindful of orientation tags and perform a physical rotate when necessary instead of relying on orientation flags across different viewers.

Q: What are practical WebP quality settings to try for photo-heavy sites?

A: Start with cwebp -q 85 -preset photo -m 6. If you need smaller files, test 75 and 80. Check critical crops and edge cases (hair, sky gradients) to find the minimal acceptable setting.

Q: How do I convert AVIF to PDF for print effectively?

A: Convert AVIF to a high-quality TIFF (16-bit if possible), perform any color-profile conversions to the target printing profile, then create a PDF that embeds the TIFF using Ghostscript or professional tools. Avoid generating a low-quality JPG for print — maintain high bit depth and correct ICC embedding.

For a quick conversion experiment you can use ImageMagick + Ghostscript as shown earlier in the guide, but professional print houses often prefer PDF/X standards which sometimes require a design tool to fully guarantee compliance.

Conclusion

Converting AVIF to WebP and JPG is not a one-size-fits-all task. The "right" settings depend on your content, the target platform, and whether you need alpha, animation, or print-quality color. Use the mapping ranges and command-line recipes in this blueprint as starting points, and build in visual checks and CI-based encoder pinning so your conversions remain predictable over time.

For web delivery, WebP with -q 80–90 is an excellent target from AVIF for most photographs; use mozjpeg at quality 85–92 for legacy compatibility and for print, prefer high-quality JPG or TIFF with embedded ICC profiles. Preserve transparency by targeting PNG or WebP alpha, and for animated AVIF prefer animated WebP over GIF when clients allow.

If you want an interactive place to try these settings before adding them to a pipeline, check AVIF2Anything.com for a privacy-first tool that exposes many of the options discussed here. And if you’re implementing a pipeline, treat this blueprint as a living document — test across your content types and lock in encoder versions to avoid surprises.

— Alexander Georges, Co-Founder & CTO, Craftle

Advertisement