Skip to content

perf(web): shrink landing features-visual image from 2.4 MB to 25 KB - #14710

Merged
dylanjeffers merged 1 commit into
mainfrom
perf/landing-features-image
Oct 26, 2026
Merged

dylanjeffers merged 1 commit into
mainfrom
perf/landing-features-image

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Summary

The landing page's "Growth starts here" visual (landing-2026/assets/features-visual.jpg) was the largest byte cost on /. Lighthouse flagged 2.26 MB of it as wasted on desktop.

Format Dimensions Bytes
Before JPEG 4096×2713 2,381,749 (2.38 MB)
After (served to modern browsers) WebP q80 1456×964 25,218 (25 KB)
After (fallback) JPEG q78 1456×964 125,340 (125 KB)

About 99% fewer bytes for browsers that support WebP.

Sizing

  • .visualWrap is at most 612px wide and min(480px, 55vh) tall, with object-fit: cover. For the image's ~1.51 aspect ratio, that renders at most about 725 CSS px wide. 1456px covers that at 2×.
  • Below 800px the visual is display: none. Lazy images inside hidden containers aren't fetched, so mobile downloads neither version.

Markup

  • <picture> with a WebP <source> and the JPEG <img> as fallback, the same pattern as Hero2026 and CreateFutureCTA.
  • Kept loading="lazy" (the image is below the fold). Added decoding="async" and width={1456} height={964} so the image has an intrinsic aspect ratio.
  • CSS: picture and img now both get width/height: 100%; display: block, so the wrapper fills the box like the Hero does.

Quality

I compared the original and the new files side by side, full frame and as 1:1 crops of the neon-sign detail. I couldn't see a difference. SSIM against a lossless downscale of the original: WebP 0.989 (Y), JPEG 0.992 (Y). The image is monochrome, which is part of why it compresses so well.

Test plan

  • eslint and prettier clean on the changed files
  • Load / on a desktop-width staging build: the visual looks the same, and the network panel shows features-visual.*.webp at about 25 KB
  • Mobile width (≤800px): the visual stays hidden and isn't requested

🤖 Generated with Claude Code

The "Growth starts here" visual was a 4096x2713 JPEG (2.38 MB) shown in a
box at most 612x480 CSS px (object-fit: cover, so ~725px wide), and hidden
below 800px. Re-encode at 1456x964 (2x the largest rendered width) as WebP
(25 KB) with a JPEG fallback (125 KB) via <picture>, add decoding="async",
and set width/height for the intrinsic aspect ratio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e112ec0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers
dylanjeffers merged commit 85fcf8d into main Oct 26, 2026
18 checks passed
@dylanjeffers
dylanjeffers deleted the perf/landing-features-image branch October 26, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant