Shadewater Labs/Webp Me Daddy example

WORKED EXAMPLE · IMAGE OPTIMIZATION

From one screenshot to four WebPs

Copy a responsive image HTML snippet with srcset and sizes. Download four WebP widths and try the example in your own layout.

Original and optimized

Webp Me Daddy exported four widths from one Shadewater Labs homepage screenshot. Compare the original JPEG with the WebP your browser chooses below.

In the preview below, srcset lists those four WebP files and their pixel widths. sizes tells the browser how wide the image will appear in the layout. The browser uses that width and the screen’s pixel density to choose a file.

Shadewater Labs homepage with its headline, flask logo, and links to BrineSpace and open-source tools.
Original JPEG · 1440 × 850 · 96.4 kB
Shadewater Labs homepage with its headline, flask logo, and links to BrineSpace and open-source tools.
Responsive WebP · browser-selected width

The exported files

WebP dimensionsFile sizeExample use
320 × 1807.4 kBNarrow cards
480 × 27013.4 kBWider cards
768 × 43224.9 kBWide or high-density cards
800 × 45026.6 kBLargest preview and fallback

These are the sizes from this run. The best file for a visitor depends on the display width and pixel density.

Which WebP did the browser load?

We loaded the on-page preview in a fresh Chromium 158 session for each viewport width and device pixel ratio (DPR), then checked the image URL the browser actually loaded. Viewport and preview widths are in CSS pixels.

ViewportPreviewDPRWebP loaded
360 px290 px1×320w WebP
360 px290 px2×768w WebP
360 px290 px3×800w WebP
390 px320 px1×320w WebP
390 px320 px2×768w WebP
640 px570 px1×768w WebP
768 px327 px1×480w WebP
768 px327 px2×768w WebP
1440 px408 px1×480w WebP
1440 px408 px2×800w WebP

At 640 px the preview fills one column. At 768 px the two images sit side by side, so the preview gets narrower and Chromium loads a smaller file at 1×. Your browser may choose differently or reuse a cached file. Check the WebP loaded caption above for your result.

Use responsive WebP images with srcset and sizes

This example uses a card up to 400 pixels wide, with 20 pixels of space on each side on narrow screens. If you host the files yourself, replace the image URLs and adjust sizes to match your layout.

At a 360 px viewport, the copied snippet gives the image 320 CSS pixels of space. At 2× pixel density, that calls for about 640 image pixels. The on-page preview uses its own layout, so use the measurements above for that preview.

The ZIP includes the original JPEG, all four WebPs, and a standalone demo. Unzip it and open index.html to try the example offline.

<img
  src="https://shadewaterlabs.com/webp-example/labs-homepage.webp"
  srcset="
    https://shadewaterlabs.com/webp-example/labs-homepage-320w.webp 320w,
    https://shadewaterlabs.com/webp-example/labs-homepage-480w.webp 480w,
    https://shadewaterlabs.com/webp-example/labs-homepage-768w.webp 768w,
    https://shadewaterlabs.com/webp-example/labs-homepage.webp 800w"
  sizes="(max-width: 440px) calc(100vw - 40px), 400px"
  width="800"
  height="450"
  alt="Shadewater Labs homepage with its headline, flask logo, and links to BrineSpace and open-source tools."
  style="width: min(calc(100vw - 40px), 400px); max-width: 100%; height: auto;"
>

See how we used this page to test crawler access in the SEO audit.

Back to Webp Me Daddy