Skip to content

perf(harmony): re-encode oversized rasters embedded in logo icons - #14565

Open
dylanjeffers wants to merge 1 commit into
mainfrom
perf/icon-raster-optimization
Open

perf(harmony): re-encode oversized rasters embedded in logo icons#14565
dylanjeffers wants to merge 1 commit into
mainfrom
perf/icon-raster-optimization

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

1 of 4 in a stack reducing the web entry chunk. Independent of the others — safe to merge on its own.

What

Five of the 253 icons in harmony/src/assets/icons carry a base64 raster embedded by the Figma export rather than vector paths, at resolutions far beyond anything they render at.

LogoCircle.svg was the worst: a 653×653 JPEG inside a 24×24 icon — 142 KB for something drawn at 24 CSS pixels. It's the AUDIO token icon, so it loads on the app shell.

Icon Before After
AudiusLogoColor.svg 351.1 KB 26.6 KB
LogoCircle.svg 142.0 KB 6.6 KB
Soundwave.svg 65.7 KB 4.6 KB
AudiusLogoHorizontalColorNew.svg 43.4 KB 32.2 KB
AudiusLogoHorizontalColor.svg 34.0 KB 27.4 KB

~538 KB of source removed.

Why not just strip the rasters

That was my first attempt. The raster is the artwork — the purple gradient — and the vector paths in the same file draw only the white mark. Stripping it renders an empty circle. So each raster was re-encoded at roughly 4× its declared CSS size (retina plus headroom) instead.

Verification

Every icon rendered before and after at 120px and compared — visually identical. No markup or path data changed, only the embedded image payload.

Suggested follow-up

A lint rule rejecting base64 under assets/icons would stop these recurring.

🤖 Generated with Claude Code

Five of the 253 icons in harmony/src/assets/icons carry a base64 raster
embedded by the Figma export rather than vector paths, at resolutions far
beyond anything they render at.

LogoCircle.svg was the worst: a 653x653 JPEG inside a 24x24 icon, 142 KB for
something drawn at 24 CSS pixels. It is used for the AUDIO token icon, so it
loads on the app shell.

The rasters cannot simply be stripped -- they carry the artwork (the purple
gradient), and the vector paths in the same file draw only the white mark.
Removing the raster renders an empty circle. So each was re-encoded at roughly
4x its declared CSS size, which is retina plus headroom:

  AudiusLogoColor.svg               351.1 KB -> 26.6 KB
  LogoCircle.svg                    142.0 KB ->  6.6 KB
  Soundwave.svg                      65.7 KB ->  4.6 KB
  AudiusLogoHorizontalColorNew.svg   43.4 KB -> 32.2 KB
  AudiusLogoHorizontalColor.svg      34.0 KB -> 27.4 KB

Each was rendered before and after at 120px and compared; they are visually
identical. No markup or path data changed, only the embedded image payload.

A lint rule rejecting `base64` under assets/icons would stop these recurring.

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

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: eb7cb6b

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

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