Skip to content

Compress images with Zopfli/oxipng#531

Open
Gold856 wants to merge 2 commits into
Mechanical-Advantage:mainfrom
Gold856:compress-images
Open

Compress images with Zopfli/oxipng#531
Gold856 wants to merge 2 commits into
Mechanical-Advantage:mainfrom
Gold856:compress-images

Conversation

@Gold856
Copy link
Copy Markdown
Contributor

@Gold856 Gold856 commented May 22, 2026

Unnecessary metadata was also stripped with --strip safe. Images in the whats-new folder were skipped on the premise that these will be removed later. In total, 8,092,487 bytes were saved. (Had I compressed the whats-new folder, that would've been 9,687,022 bytes... important to run oxipng before you push commits up! Maybe a pre-commit hook?)

@Gold856 Gold856 force-pushed the compress-images branch from c7aaf16 to fd72a0b Compare May 22, 2026 04:10
@blaze-developer
Copy link
Copy Markdown
Contributor

blaze-developer commented May 22, 2026

I'm struggling to see the idea. Sure, smaller file size is nice, but does that mean that every single contribution henceforth should be held to the standard of compressing images?

I'm don't see the motivation for this initiative or the problem that this solves. By modern standards, 8 megabytes is very small, especially on a platform where you have up to 100 megabytes per file.

Obviously saving data is saving data, and if it makes sense it should be merged, but I don't know if the effort is very necessary moving forward.

Is there any specific reason for it I haven't considered? I apologize if I'm missing something.

@blaze-developer
Copy link
Copy Markdown
Contributor

blaze-developer commented May 22, 2026

It might make more sense to run this as a Github action, for an automated slight-benefit, rather than running it manually for every image.

@Gold856
Copy link
Copy Markdown
Contributor Author

Gold856 commented May 22, 2026

does that mean that every single contribution henceforth should be held to the standard of compressing images?

Maybe, maybe not. It is a bit time consuming to run locally (Zopfli trades off a lot of time for space) but some sort of automation (likely via GitHub Actions like you mentioned) could make that easier.

As for motivation, I just like saving space :). Primarily, the reason is to save space in the WPILib installer, which is already a monstrous 2+ GB blob. I recognize that the amount is small (especially compared to the installer), and so I know rejection is always a possibility (especially because it does bloat repo size), but after doing this to both Elastic and frc-docs, I have saved close to 30 MB across those two repos, and this will get me to ~40 MB. It legitimately does start adding up... but it is easy to undo. I think just upgrading Electron to the latest version will set back all the gains here.

It's a much better idea to compress before committing to the main repo though (for repo size reasons), but this is as good as we can get.

@blaze-developer
Copy link
Copy Markdown
Contributor

I hadn't considered the size of the WPILib installer. Thanks for clarifying that makes a little bit more sense although it's small :)

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.

2 participants