Repository navigation
feat: downscale images that are much larger than displayed - #1379
Merged
Merged
Conversation
1784 PNGs were more than 2.3x wider than their largest display width on any page, e.g. 1344x2992 phone screenshots shown at 180x400. Downscale them to twice their display width (capped at the 1300px content column) with ImageMagick (Lanczos) and recompress with oxipng. Files where the result wasn't smaller are left unchanged, so 1286 images change. Also add a note on the maximum image resolution to the README.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Only the README diff is available, so the 1,286 resized images cannot be checked for retained content, aspect ratios, or visual quality.
No open issues 🎉
What changed in this PR
This PR aims to reduce screenshot download sizes while preserving display layout and high-DPI clarity. The reviewed README change documents sizing guidance to support that goal.
Changes:
- Clarifies that screenshot width guidelines refer to display sizes.
- Recommends saving images at no more than twice their displayed dimensions, with examples for pop-ups and phone screenshots.
- Sets a 2600px maximum width for full-screen screenshots based on the 1300px content-column limit.
| File | Description |
|---|---|
| README.md | Adds screenshot sizing guidance to reduce image downloads while retaining clarity. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Many screenshots are stored much larger than they are ever displayed. For example, the Android screenshots are 1344×2992 px but shown at 180×400 px. Readers download the full file anyway. This PR downscales those images to twice their display size, which is still sharp on high-DPI (Retina) screens.
Download size for readers
Image bytes of all images on a page, summed over every page of the built site: 445 MB → 265 MB (-40%). No page got bigger.
Per page, measured in Chromium after scrolling through the whole page:
user/ios-app/files-and-folders/create-rename-moveuser/android-app/files-and-folders/create-rename-moveuser/ios-app/shortcuts(de)user/ios-app/general/set-upuser/general/settingsAll images the site serves: 103 MB → 72 MB.
How
widthattribute (or astylewidth), capped at 1300 px. 1300 px is the widest the content column gets: 958 px with a table of contents, 1288 px without one.-filter Lanczos) and recompressed withoxipng -o 2 --strip safe. Images are never upscaled and stay PNG.width/heightattributes in the docs stay the same, so the layout doesn't change.Checked in Playwright
main, including phone screenshots, a photo and full-width screenshots with small text. At DPR 2 they look the same. At DPR 3 (many phones), the 2× images are scaled up 1.5×, so text looks very slightly softer in a direct side-by-side comparison, but it's fully legible.pnpm build,pnpm lint:mdandpnpm format:checkpass. The broken-anchor warnings are the same 50 as onmain.