Skip to content

Shrink oversized network logos and use Ink's icon - #179

Open
karelxfi wants to merge 2 commits into
mainfrom
claude/optimize-network-logos
Open

karelxfi wants to merge 2 commits into
mainfrom
claude/optimize-network-logos

Conversation

@karelxfi

@karelxfi karelxfi commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Network logos are shown at 20 to 48 px next to the chain name, in the docs and on sqd.dev, but many files were far larger than that. zora.png alone was a 1.5 MB, 2390 px image, downloaded in full wherever Zora's logo appears.

Changes

All file names stay the same, so no metadata.yml entry changes. Apart from the resize itself, every change is lossless.

  • Size. PNGs over 256 px are downscaled to fit 256 × 256 (Lanczos, with aspect ratio, transparency and color profile kept) when that makes the file smaller. 13 PNGs that are already only 2 to 18 KB at 257 to 600 px stay as they are, and the three JPEGs are untouched to avoid a second round of JPEG compression. soneium.svg now embeds its image at 256 px instead of 561 px. 60 files go from 4.94 MB to 1.52 MB, and the whole img/networks folder from 5.51 MB to 2.09 MB.

    File Before After
    zora.png 1,523 KB 50 KB
    soneium.svg 379 KB 88 KB
    berachain.png 258 KB 40 KB
    nebula.png 237 KB 79 KB
    dogechain.png 205 KB 64 KB
    mantle.png 193 KB 26 KB
  • Formats that didn't match the extension. Nine files held different data than their name says:

    • blast.png, kyoto.png, sonic.png and tanssi.png held WebP.
    • naka-chain.png held AVIF.
    • katana.png and kintsugi.png held JPEG.
    • hemi.jpg held AVIF.
    • merlin.jpg held PNG.

    The seven .png files are now real PNGs. hemi.jpg and merlin.jpg use transparency, which JPEG can't hold, so both are now PNG data. Browsers read them either way, but PNG also works in tools that only read PNG and JPEG. Six of these files are larger than the WebP, AVIF or JPEG they replace; the biggest increase is sonic.png, from 11 KB to 67 KB.

  • Ink. ink.svg was the full wordmark, which shrinks to an unreadable strip at 20 px. It is now the Ink icon alone: the same path, cropped to its 275 × 275 box. Both Ink datasets already point at this file.

  • README. New section with these rules for future logos.

Verification

  • Unresized files: the 13 that were only recompressed or converted (for example sonic.png from WebP, hemi.jpg from AVIF) are pixel-identical to the originals.
  • Resized files: all 45 were compared with their originals side by side at 200 px, and composited on white and on a dark background at 20 and 48 px. The largest average difference is 0.4 of 255 levels.
  • Color profiles: every ICC profile is unchanged, including the non-sRGB ones in bittensor.png and tinker.png. The AVIF sources are tagged sRGB or untagged and the WebP sources have no profile, so the PNG versions show the same colors.
  • SVGs: both were checked in Chrome as well as with rsvg. The Ink icon is pixel-identical to the left 275 px of the old wordmark. soneium.svg looks the same at 30, 48 and 128 px, with slightly smoother edges at 48 px because the browser now scales it down from 256 px instead of 561 px.
  • Tests: node --test tests/*.test.js passes (6 tests).

GitHub's 2-up view shows each image at its own size, so a 256 px file appears next to a 2000 px original. At the 20 to 48 px where logos are used, 256 px is still more than enough, even on 3× screens.

Rollout

cdn.subsquid.io caches these files for up to 4 hours, so updated files can take that long to appear after merge.

🤖 Generated with Claude Code

karelxfi and others added 2 commits September 26, 2026 11:36
Network logos are shown at 20 to 48 px, but many files were far larger:
zora.png was a 1.5 MB, 2390 px image. Every raster over 256 px is now
downscaled to fit 256 x 256 (aspect ratio, transparency and color profile
kept), and soneium.svg embeds its image at 256 px instead of 561 px.
63 files go from 5.00 MB to 1.55 MB. File names and formats are
unchanged, so no metadata entry changes.

Nine files held a different format than their extension: WebP, AVIF or
JPEG data in .png files, and AVIF or PNG data in .jpg files. The .png
files are now real PNGs. hemi.jpg and merlin.jpg need transparency, which
JPEG cannot hold, so both are now PNG data. The PNGs are larger than the
WebP and AVIF they replace, but any decoder can read them.

ink.svg was the Ink wordmark. It is now the Ink icon on its own: the
same path, cropped to the icon's 275 x 275 box.

The README now lists these rules for new logos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-encoding adi.jpg, hashkey.jpg and invarch.jpeg at 256 px added a
second round of JPEG compression to save 2 to 34 KB. Every other change
in this PR is lossless apart from the resize, so these three go back to
their original bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@karelxfi
karelxfi marked this pull request as ready for review September 26, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant