Standards
Pick JPEG, WebP or AVIF by Testing the Image People Will See
Compare picture quality, browser behavior and transfer size using the same original photograph and a useful fallback.

A photograph of a dark room carries smooth shadows, a bright window and a woven sofa. The photographer exported one file, the publishing system generated another, and a share preview pulled a third. Each image may have a different quality setting even when it is displayed at precisely the same size. The differences matter at the place where the image tells the story. A small file can keep visitors from waiting, while damaged texture can remove what they came to see. JPEG, WebP and AVIF all have useful roles. To decide among them, separate the intended display from the archive and compare files made from the same original.
Keep a record of the intended contrast and color in the source itself. When an editor works from a photo displayed on an unusually bright screen, crushed shadows may be less visible than they are on a typical phone. An ordinary brightness setting and an export that several people can view under comparable conditions help everyone agree on whether the image communicates what it should.
Define which image this is supposed to be
Keep one source file for editing, archival or future exports. For a camera photograph, that could be a raw original and an edited master in a format chosen for your workflow. Then list the copies that readers need. A website might deliver a wide hero crop for desktop, a smaller crop for a portrait phone, a thumbnail and a share image used by external applications. Those assets can share one subject and still require different export choices. A vertical file trimmed to a wide strip can lose key details before compression begins. A square thumb for a story about a chair should preserve the chair. Export dimensions alone say nothing about whether the crop shows the intended subject.
Measure where the picture is displayed. A 1200-pixel image can be oversized for a card rendered at 280 CSS pixels. On a high-density display, serving more than 280 physical pixels might improve clarity, but the exact requirement depends on the layout and device. Responsive image metadata lets the browser select an appropriate candidate using the device and its understanding of the layout. Test at a few realistic viewport widths. If a card always requests the full desktop file, resizing the source candidates will probably save more bytes than a change in format. Put the intrinsic dimensions in the markup to reserve space and set any crop deliberately in the stylesheet or in the alternate source image.
Use representative source images for the comparison
Choose a handful of images with conflicting demands. A portrait has skin tones and hair, a dark interior has shadow gradients, and a photograph of a bookshelf has small high-contrast edges. Include a scene with wood texture or leaves, which can turn smeared before a person looking at a compression graph notices. Add a transparent icon or screenshot only if it belongs to the actual website. A format that excels at photographs may be a poor choice for text over a flat background. SVG is often appropriate for a trusted vector graphic, and PNG or lossless WebP can be suitable for artwork with sensitive edges. Keep testing inputs consistent to avoid comparing one image already degraded by a previous export with another made from a clean master.
Generate a few settings for each candidate at the same display dimensions. Encoder quality levels are tool-specific, so JPEG quality 80 does not mean WebP quality 80 or AVIF quality 80. Start with a small spread of export settings and choose the best looking option each format offers around your size goal. Preserve the logs for settings and recorded output sizes. Check that dimensions are unchanged and that each export has the intended color profile and orientation. Strip unneeded metadata from delivery images where appropriate, including location data you did not intend to share. Preserve necessary rights information according to your source and license, even when it is recorded away from the rendered image.
Judge the parts that carry meaning
Open the files locally or in a controlled preview page with the same background and size. View them in a randomized order if many people will compare results. Inspect the meaningful areas at normal display size first. In a dim room photograph, the woven fabric might carry information about the design. Sharp edges in a close-up of a cable can help somebody distinguish two plug shapes. A variant could save half the bytes and still become unacceptable if those areas look like flat patches. A quick zoom can make differences easier to diagnose, but the primary decision should match how the page displays the image on an ordinary screen.
Look for ringing around text or sharp lines, blotchy dark tones, lost fine detail and unusual color shifts. Changes in the browser, image conversion tool, or source color space can produce differences beyond compression. If an AVIF appears much darker, check the export and display pipeline before attributing the change to the format. Transparency also deserves a test over a dark and a light background, especially if tiny features blend into one color. For very small thumbnails a lighter file may be acceptable because the lost texture is below the visible detail anyway. For a lead image taking up most of a screen, preserve the features that make the picture immediately recognizable.
Confirm support where the image leaves the browser
JPEG remains widely readable for photographs, including in software beyond the browser. WebP supports lossy and lossless encoding along with transparency and other features. AVIF can be efficient for some images and settings. The savings vary by source and encoder, and a format's theoretical capability does not establish that every publishing tool reads it correctly. Consult the browser and application support information relevant to your actual audience. A small project may want a JPEG equivalent for interchange and a modern variant for browser delivery. Keep the extension and server content type consistent. A file named as a JPEG can still fail in outside tools if it contains another format.
In a browser, a picture element can list modern sources with their media types and leave a dependable image element at the end. That element carries meaningful alternative text where the image is informative and dimensions appropriate to the rendered crop. A plain image source can keep simple pages easy to maintain if modern sources would add complexity without saving significant bytes. More advanced content negotiation has its own cache considerations. If the server varies a response by the browser's Accept header, ensure the caching system treats the possible output formats correctly. Test as a fresh visitor. The last image the developer cached may hide a missing fall back or a response that is being reused for an unsupported client.
Use the same file budget on the full page
Look at the homepage or article through a real browser on a slower connection. Record which image comes from the network and where its first visible rendering occurs in the timeline. A hero photo likely needs early fetching, whereas offscreen gallery images can wait until closer to the viewport. Supplying high priority to every card just makes more requests compete. Responsive sizes should match the layout so the browser doesn't choose an enormous asset for a narrow column. Check whether font and styling requests push the image down the queue. A smaller file can help, but a late request caused by a script that hasn't initialized may still dominate the delay.
Repeat the test after touching several areas of the site to see whether the publishing system creates an excess of variants or discards useful cached copies. Decide which sizes and formats the editor must produce and automate only that set. A site that publishes once a month may be happy to generate outputs locally. A larger site may need a reliable conversion step with a predictable path convention so a broken image can be found quickly. Add a check that every article has a valid fallback and a known intrinsic aspect ratio. Fonts, core controls and the first section of text should still work even briefly if an image is unavailable.
In a newsroom, the person who exports a photo is often different from the person who enters all the story fields. Give both people the same image budget and define where to place the master. A thumbnail created by dragging a browser image into an editor can quietly reuse a heavily compressed derivative. A file chooser that points the editor back to the master prevents that mistake and preserves the option to publish a different crop later.
Leave a small image recipe with the master
For each representative picture, keep the original, the final crop specification and a short record of the exports used. State the format and dimensions for the share asset if it differs from the browser image, and record where it was verified. Make a thumbnail at the correct size and check that it resembles the article's subject. An accessible description is a content task separate from the codec. Write it from what the image shows and why it is present, or leave the alt empty when a separate image is fully decorative. Filenames and encoder names don't help a reader picture the scene.
The best result is easy for another person to reproduce. They should be able to open the master, export the intended crop, verify one variant at the small size and check the fallback in a real browser. A codec can give that person a smaller file, and a disciplined workflow will also make sure that the picture remains readable when the file is sent somewhere the publisher never anticipated.



