Find the image the browser actually requests
Imagine that your home page displays a heading and a product photograph above the first button. The text shows up immediately, while the photograph arrives late. A smaller file might help. The browser might also be discovering the image late, or sending a desktop-size file to a phone. Start by identifying the request so you can tell which change addresses the problem.
Open the page in desktop Chrome. On Windows or Linux, press Ctrl + Shift + I. On a Mac, press Command + Option + I. You can also open the three-dot menu, choose More tools, and select Developer tools. A panel will open to the side or bottom. Select Network. If you do not see that label, look under the overflow chevrons in the panel’s tab bar. Choose Img to show image requests, tick Disable cache, and reload the page. The checkbox applies while DevTools is open. Chrome’s illustrated Network guide
Read the Name, Size, and Waterfall columns. Name lets you spot a known file. Size reports the transfer or notes a cache hit. Waterfall shows when the request started and how it progressed. Select a row and choose Preview to see which picture it contains. In Headers, look for Content-Type. A file name ending in .jpg can still be served as WebP by the image service. Read the response header before deciding which encoder the site uses. Click the Size heading if you want to bring the largest transfers to the top.
Next, select the phone-and-tablet icon at the top of DevTools and pick a phone profile. Reload with the same cache setting. The browser can reuse an image it already downloaded, so a fresh mobile run is useful. Record the profile and the image URL. Open the same page on a real phone if you have one. Emulation helps show which file the browser picks, and a device check helps catch text or details that are hard to see when you hold the phone normally.
Pick a format that fits the content
| Content | First options to compare | What to look for |
|---|---|---|
| Product, interior, or landscape photograph | WebP, AVIF, and JPEG as needed | Tones, edges, texture, and acceptable file size |
| Screenshot with small type | PNG and lossless WebP | Legible text and crisp lines at the display size |
| Logo, icon, or diagram made of shapes | SVG from a trusted source | Clear shapes at small sizes and a useful accessible label |
| Transparent asset | WebP or PNG, and AVIF where supported | Clean edges on light and dark backgrounds |
| Long moving illustration | Video with playback controls and a poster | Download cost, playback behavior, and accessibility |
JPEG, PNG, WebP, AVIF, and SVG have published specifications. There is no single required image format for websites. WebP is a practical default to test for photographs, especially when the content editor or delivery service already supports it. AVIF is also widely supported in modern browsers, and it is worth comparing on your own files. Keep a suitable fallback if your audience uses older browsers or if an export is reused in a tool with different support. The browser can pick a supported source from a <picture> element. MDN format and compatibility guide
Walk through a small design check before exporting the whole catalogue. For a transparent logo, put the export on light and dark backgrounds. Look for an opaque rectangle, a pale halo, or jagged strokes. For a screenshot, zoom in on a number in a table and a dark label on a light background. Check the image at the size it will appear in the article. A file that looks fine in a full-screen editor can lose a label on a mobile page. If that label matters to the guide, using a lossless format or cropping to the relevant area can help people read it.
Worked example: one gallery photo in four formats
I used a frame from the evolkov.tech gallery. I resized it to 960 × 600 pixels and exported each variant from the same image using Pillow. I reopened all four files to check the dimensions and recorded their actual size on disk. The images below come from those exports.
| Format | Export setting | File size |
|---|---|---|
| JPEG | Quality 82 | 53,901 bytes |
| WebP | Quality 82 | 25,516 bytes |
| AVIF | Quality 62 | 22,863 bytes |
| PNG | Lossless | 507,312 bytes |
In this example, the WebP export is about 53% smaller than JPEG. The AVIF export is about 10% smaller than WebP. These are measurements for a single photograph and those settings. The two quality sliders do not share a common scale, and the PNG export preserves the pixels losslessly. Try the same test on a photograph with skin, one with a fine texture, and a screenshot if those are common on your site. Choose the smallest version you are comfortable publishing. Download the recorded file sizes and settings
For a browser-based test, open Squoosh and drag in a copy of your image. Set the target dimensions first. Select WebP, vary the quality, and move the divider across an area with texture or small details. Save the candidate and repeat for AVIF or your fallback. Open the downloads at their normal display size and compare the byte counts. If lettering becomes blurry or a gradient develops bands, try a higher quality setting. Keep the source file so later edits do not need to start with a compressed export. Squoosh source and documentation
Resize for the space the image actually occupies
Say a mobile card is roughly 360 CSS pixels wide. On a screen with 2× density, an image close to 720 pixels wide may be useful. If the browser downloads a 2,400-pixel file, the visitor may be paying for pixels they cannot see at that size. Save the larger version for a zoom view if that is part of the experience. For the card, start with a few candidates such as 480, 768, and 1,200 pixels, then see which one the browser chooses. Adapt the sizes to your layout and device mix.
If your editor lets you choose an image size, try it on a test page first and repeat the Network check. If you manage the template, start with this example. The paths are illustrative. srcset describes the available widths. sizes estimates the occupied width in the layout. The width and height attributes give the browser an aspect ratio before the file arrives.
<img
src="/images/gallery-768.webp"
srcset="/images/gallery-480.webp 480w,
/images/gallery-768.webp 768w,
/images/gallery-1200.webp 1200w"
sizes="(max-width: 760px) 100vw, 720px"
width="960"
height="600"
alt="Timber beams and framed work in the exhibition room"
>
Replace the values in sizes with the actual card width for your layout. For a layout with two columns, the image may use close to half the content width on desktop. Use responsive CSS such as max-width: 100% and height: auto when it matches the design. To verify your change, inspect the image in Chrome’s Elements panel, then enter $0.currentSrc in the Console for that selected element. The displayed address is the current file. Confirm it also appears in the Network log after a fresh reload. Chrome can choose a different candidate based on the device and its conditions. How responsive image selection works
Load the important image early
The most important image on the first screen can be an LCP candidate. Largest Contentful Paint records when the largest eligible visible piece of content is rendered. Sometimes it is a headline. Sometimes it is the hero picture or a product image. Use a report or Chrome’s Performance panel to find which element was measured on the page you are testing. If the measured image is present near the top and matters to the visitor, give the browser its address early in the HTML. Check that it has not been marked loading="lazy". Test fetchpriority="high" for the candidate when appropriate. Apply it to the file that matters and verify the waterfall again. LCP guidance from Chrome · Worked LCP image example
For other images that start below the screen, loading="lazy" can defer transfers. Scroll the page on a slower connection and see whether the image arrives close to when it is needed. Give each picture dimensions so content does not shift as it arrives. On a page that uses separate mobile and desktop crops, check that the rule reserves enough space on both. A thumbnail that arrives quickly is still frustrating if the caption and Buy button move while the visitor tries to use them. Worked layout shift example
Verify that the browser receives the lighter image
For a second experiment, I resized the same gallery source to 768 × 480 and made two exports. The browser displayed each at 361 CSS pixels in a 393-pixel viewport. I loaded the local page in Chrome three times per format. The browser received a 34,332-byte JPEG response body and a 16,716-byte WebP response body, about 51% less for this image. That figure comes from encodedBodySize, so it excludes the response headers. Important details stayed visible at the tested display size, and median LCP remained between 24 and 28 ms in the local test. The experiment verifies the byte reduction. Measure loading separately for your visitors. All six measurements · What encodedBodySize measures
To try the replacement without editing the template, keep the original file and open a copy of the page. In the WordPress block editor, select the Image block, choose Replace, and upload the new file. Verify the alt text, caption, crop, and what happens when someone clicks it. For a featured image, update the post setting and check both the article and the listing card. Your site editor may use different menu labels. WordPress Image block documentation
Open the original and candidate in the same mobile profile with the browser cache disabled. On each version, filter Network to Img, reload, and select the matching request. Check Status, Content-Type, and Size. Release the replacement when the intended browser receives the lighter file, the visible detail survives, and the layout and links still work. If your editor generated a larger or differently encoded variant, inspect srcset and the image CDN. If a supported browser shows a blank image, restore the previous asset and test a fallback before trying again.
Compare before and after on the page
Keep the URL, device profile, and network settings comparable. Capture the original request URL, selected image dimensions, and number of bytes. Replace one image or adjust its loading attribute. Reload in the same conditions, open the matching row, and record those values again. For LCP or other timings that fluctuate, run several repeats and compare the median. If the file got smaller but the image still appears late, check when the request starts and what happens before the browser paints it. A late discovery, a slow document response, or scripts occupying the browser can delay even a small image. How to compare Lighthouse runs
Finish by using the site. Open the mobile view, scroll to the gallery, and try any full-size viewer. Check readable labels, important details, and whether the controls still work. Give informative images concise alternative text. Use an empty alt="" for decorative images when the surrounding text already communicates their meaning. When an image acts as a link, give the link an accessible name that tells people what it opens. Save the two observations and the change in a brief note so another editor can reproduce the result.
Common questions
Is AVIF always smaller?
Compare it with WebP at a size and quality you can use. Encoders make different tradeoffs for fine textures, small type, and color. If the result is very close, use the better fit for your upload, CDN, and browser requirements. For a large catalogue, try several representative products before changing defaults.
Can I convert a file by changing its extension?
Changing its name leaves the encoded image unchanged. Reopen the source, export it with the codec you want and upload the result. Check the response type and size in the browser, especially if your CDN negotiates or transforms images. Save a copy of the original for future edits.
Next steps: testing a Shopify product page and diagnosing a low mobile PageSpeed score.
Need help with your website?
Development and SEO services →


