-
-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lossless Image Optimisation Example Images #4189
Conversation
Saved 12.6 MB out of 20.8 MB. 30% per file on average.
Thanks! Line 61 in cdf93b0
|
I'm not sure what the instruction would be though. Perhaps:? (Optional) You can reduce the file-size of the example image with https://squoosh.app/ Overall though, I think this could better be tackled separately with a command line script or a GitHub Action. |
If you can do it in a github action, then you should be able to simply add it to the generate-images.ts script, assuming this is something that anyone can do without installing too much stuff.
|
Could it be interesting to move to webp image format as it is widely adopted for a while now ? It could help to further reduce file size as par https://developers.google.com/speed/webp/docs/webp_study |
I have no objections as long as there's an easy way to generate them as part of the image generation script. |
@coliff @YohanSciubukgian any updates on this? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4189 +/- ##
==========================================
- Coverage 87.65% 87.44% -0.22%
==========================================
Files 242 242
Lines 33076 33076
Branches 2182 2171 -11
==========================================
- Hits 28992 28922 -70
- Misses 3090 3171 +81
+ Partials 994 983 -11 ☔ View full report in Codecov by Sentry. |
As it stands, the changes in this PR is a huge improvement. I personally think it's worth merging as it is for now. I don't really have the time/motivation to move the generate images to WebP. (separately though, we should also lazy-load the images. That way not all 99 images all load on the page right away, and will only load as a user scrolls near. That will help a huge amount! Mkdocs-Material supports this: |
Can you add a comment at least in the readme for users who are generating images using the script to let them know how to compress it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THANKS!!
I was not able to reduce a png image size with https://squoosh.app/ |
Hmm, Maybe you were not doing it correctly then? I think squoosh.app is the best and is updated regularly with the best/latest compression. Select OxiPNG in the Compress dropdown. |
I got 9% at best with squoosh. With https://compresspng.com/ I got 63%. |
ok up to you, but compresspng.com won't work well for high fidelity images if they are reducing them to 8-bit (256 colors) - it uses lossy compression. it appears to rename files too. Squoosh's OxiPNG compression is lossless by default. |
These are "thumbnails" for the examples, I don't need it pixel perfect and use a lossless compression, on the contrary, I need the image to be small and represent the example well, much like the addition of lazy. |
Hi @HarelM, sorry to be late on this. I just made a PR to address the webp image format optimization. |
Saved 12.6 MB out of 20.8 MB. 30% per file on average.
I used ImageOptim app for macOS.
Launch Checklist
CHANGELOG.md
under the## main
section.