STATUS IS UPWEBSITE OPTIMIZATION WIKI
17Accelerate
Performance and delivery / Accelerate

AVIF, WebP, JPEG, and PNG: Choose the Right Image Format

Choose the format from the image’s job, your audience, and a tested fallback path. AVIF and WebP can reduce transfer weight, but JPEG and PNG still make dependable fallbacks when compatibility or exact pixels matter.

AVIF, WebP, JPEG, and PNG: Choose the Right Image Format — VISUAL GUIDE
READ
8 minutes
SOURCES
7
REVALIDATE
2027-03-27
reviewed
Web performance and delivery reviewer
THE SHORT ANSWER

Start with the decision.

There is no single best image format for the web. For a photographic hero or product image, start by testing AVIF, then offer WebP and a JPEG fallback when your required audience includes clients that may not decode newer formats. For a screenshot, diagram, or text-heavy graphic, retain a lossless master and compare lossless WebP or AVIF with PNG; use PNG as the broadly compatible fallback when transparency or exact edges are required. JPEG remains the dependable fallback for opaque photographs, but it has no alpha channel.

Treat conversion as a controlled delivery change. Compare file size and the important crop at displayed sizes, publish ordered sources through picture, set dimensions, and test CDN responses, MIME types, caching, and fallback before release. That protects content when a preferred format is unavailable.

VISUAL GUIDE

See the work as a system.

Use this map to connect the article’s decisions before acting on individual tactics.

SIUAccelerate
01Choose by the job the image must do
02Understand what each format contributes
03Build a fallback path instead of betting on one format
04Budget encoding time and protect visual quality
01

Choose by the job the image must do

Begin with the asset, not the extension. A photograph is continuous-tone content, so some loss can be acceptable at its displayed size. A screenshot, chart, logo, or line drawing has crisp edges and text, where artifacts are conspicuous. Preserve these with lossless output or careful approval. Use SVG for a vector logo or diagram when available.

Then identify capabilities. Alpha means per-pixel transparency. Animation is a sequence of frames. Required browser coverage, publishing volume, and build time are delivery constraints that can override a smaller format.

Opaque photographs

Test lossy AVIF and WebP first. Keep JPEG available when a broadly compatible opaque fallback is needed.

Sharp graphics and screenshots

Keep a lossless source. Compare PNG with lossless WebP or AVIF at the actual display scale before choosing.

Transparent artwork

Use AVIF, WebP, or PNG; do not choose JPEG because it does not carry an alpha channel.

02

Understand what each format contributes

AVIF stores AV1-coded images in a HEIF-based format. Its specification includes still images, image sequences, and alpha image items. It supports lossy and lossless encoding, transparency, and animation. Savings are not fixed: source content, encoder, speed, target quality, and metadata change the result.

WebP supports lossy and lossless modes, transparency, and animation. JPEG is a lossy still-image format with very broad historical support, useful as an opaque-photo fallback. PNG is lossless with alpha, making it a sound fallback for exact graphics, though photographic PNGs are often inefficient. Ordinary PNG is static; test a separate animation format when motion is needed.

AVIF

Best explored for high-value raster images where smaller transfer size can justify encoding and fallback work.

WebP

Useful as a modern general-purpose raster option, including transparency and animated sequences.

JPEG

Use for opaque photographic fallback, not for a transparent logo or cutout.

PNG

Use for lossless, transparent raster fallback and for assets where pixel fidelity matters more than minimum bytes.

03

Build a fallback path instead of betting on one format

The picture element lets a browser evaluate alternatives. Put AVIF first, then WebP, then an img fallback in JPEG or PNG, with the right MIME type. The browser skips an unsupported source and uses the fallback when no source is usable. Keep the same meaningful alternative text unless you intentionally change the crop.

Format fallback does not replace responsive sizing. Supply width-based candidates and a truthful sizes value when the slot varies. Include width and height so the browser can reserve space. A small-format file at an oversized pixel dimension still wastes bytes.

Suggested source order

AVIF first, WebP second, then JPEG for opaque photos or PNG when the fallback needs transparency or lossless edges.

Cache caution

If a server selects formats from request capabilities rather than picture markup, configure cache variation correctly and test that each client receives a decodable representation.

Fallback test

Use a client without the preferred decoder or deliberately disable a source in staging; confirm that the image, dimensions, and alternative text remain correct.

04

Budget encoding time and protect visual quality

Modern compression moves work into encoding. AVIF’s reference encoder offers a speed range from 0, slowest, to 10, fastest; WebP also trades more encoder work for time, output size, and quality. Treat a batch re-encode or on-demand transformation as an operational decision, not a free setting change.

Set a repeatable policy by asset class and review originals at common display sizes. Inspect faces, gradients, text, edges, and transparent boundaries. Keep the master and record encoder version and settings so a defect can be reproduced and rolled back.

Speed is a trade-off

Faster encoding can reduce build pressure but may produce a larger file or less efficient compression; benchmark your own source set.

Quality is not one number

A score or preset cannot replace visual review of the image regions that carry meaning for visitors.

05

Make image-format changes a proactive reliability practice

For Status Is UP, image optimization is proactive uptime work when it prevents a release from degrading a critical page. Inventory critical image URLs, stage a representative conversion, and verify content type, CDN behavior, and cache invalidation before a site-wide migration.

Deploy in a reversible batch. Compare rendering and transfer behavior on the release candidate, then keep the old representation until the new path is proven. If a transformation or cache rule fails, restore the known-good source. This is a resilient delivery direction, not a universal mandate for AVIF or multiple formats.

Protect critical images first

Prioritize the lead image and content images that influence the first useful view, not every archive image at once.

Prepare rollback

Keep deterministic asset names or a versioned mapping so the prior JPEG, PNG, or WebP path can be restored quickly.

ACTION / VERIFY

Your practical to-do guide.

  1. 01

    Classify the asset

    Record whether each target is a photo, sharp graphic, transparent asset, or animation.

    VERIFY: The inventory records source master, visible role, transparency need, and intended motion.
  2. 02

    Pick a pilot set

    Choose representative high-impact images before converting a library.

    VERIFY: The pilot covers image types on the priority page.
  3. 03

    Create controlled variants

    Generate AVIF, WebP, and the needed JPEG or PNG fallback from one master.

    VERIFY: Each candidate has known dimensions, encoder version, and settings.
  4. 04

    Review the actual render

    Inspect candidates at common display sizes for text, gradients, faces, edges, and transparency.

    VERIFY: A reviewer approves the important crop with no material artifact.
  5. 05

    Add responsive sources and dimensions

    Use picture where needed, provide suitable size candidates, and state width and height.

    VERIFY: A layout test selects the right resource without image-driven layout shift.
  6. 06

    Verify delivery behavior

    Check content type, response path, CDN transformation, and cache rules in staging.

    VERIFY: Each selected image has its expected MIME type and an existing object.
  7. 07

    Exercise the fallback

    Test a condition that cannot use the preferred source.

    VERIFY: The fallback preserves content, alternative text, dimensions, and acceptable visuals.
  8. 08

    Release with a rollback map

    Keep the prior representation and a documented restore path.

    VERIFY: A release owner can identify and restore the prior asset mapping.
DISCUSSION TOPICS

Compare the trade-offs, not private data.

Use these prompts with your team or website-owner community. Share methods and lessons, but never paste credentials, customer records, or non-public infrastructure details.

  1. 01

    Which image class on your site produces the most visible trade-off between byte savings and visual quality, and how do you review it?

  2. 02

    What fallback format has proven most useful for the browsers or embedded clients your visitors actually use?

  3. 03

    How do you keep image conversion settings reproducible when a team needs to roll back a release?

POPULAR / AUTHORITATIVE RESOURCES

Open the source material.

MDN Web DocsImage file type and format guide ↗

A practical browser-focused comparison of raster formats, compression modes, transparency, animation, and fallback choices.

Reviewed 2026-09-27
MDN Web DocsHTML picture element reference ↗

Explains source selection, type-based alternatives, responsive candidates, and the role of the img fallback.

Reviewed 2026-09-27
W3CPortable Network Graphics specification, Third Edition ↗

The current PNG recommendation for lossless raster images, alpha support, and PNG’s static or animated scope.

Reviewed 2026-09-27
Alliance for Open MediaAV1 Image File Format specification ↗

The maintained AVIF specification, including its image-sequence and alpha-image definitions.

Reviewed 2026-09-27
web.devUsing AVIF to compress images on your site ↗

Google’s practical guidance on AVIF encoder controls, quality testing, and image-performance limits.

Reviewed 2026-09-27
Google for Developerscwebp reference ↗

Official WebP encoder documentation for lossless and lossy controls, alpha settings, and speed-quality trade-offs.

Reviewed 2026-09-27
WHATWGHTML images ↗

The living HTML standard for responsive image selection and width and height behavior.

Reviewed 2026-09-27

Source policy. Claims about format capabilities, HTML behavior, and encoder trade-offs are grounded in the official specifications and documentation listed in Resources. Recommendations are conditional on testing the organization’s assets, audience, and delivery configuration; navigation links are not evidence sources.

QUICK CLARIFICATIONS

Common questions.

Is AVIF always the best image format for the web?

No. AVIF is a strong option to test, but the decision depends on visible quality, required client coverage, encoding capacity, and a working fallback. A photo may benefit from AVIF while an exact graphic may need lossless output and a PNG fallback.

Should I replace every JPEG and PNG with WebP or AVIF?

Not blindly. Start with high-impact images and retain masters. Convert where review approves the visual result and delivery path. PNG can remain right for lossless graphics and transparency, and JPEG can remain an opaque photographic fallback.

Do modern formats remove the need for responsive images?

No. Format selection and size selection solve different problems. Picture helps choose a supported format, while srcset and sizes help select a suitable resolution. Width and height still let the browser reserve space before the image arrives.

Status Is UP Editorial Team · Uptime Enablement Editors

Reviewed by Web performance and delivery reviewer. Published 2026-09-27; updated 2026-09-30.