-
Notifications
You must be signed in to change notification settings - Fork 332
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
Convert assets GIFs to a smaller format or ban them #361
Comments
Other suggestions that came up:
|
A quick search shows that there are 5 assets that weight more than 1M:
Some of the large PNG files could be downsized, given how tinny the preview is on the website, I see a 2144x1360 png. I ran fd -e png . -x ls --size --human-readable {} |
sort --human-numeric-sort |
tail -40 |
cut -f2- -d' ' |
xargs file Click to expand list of all assets of more than 50K52K ./Apps/Games/libracity.png 52K ./Apps/Games/One-Click-Ninja.png 52K ./Apps/Games/punchy.png 52K ./Assets/3D/bevy_mod_picking.png 60K ./Apps/Games/typey-birb.png 60K ./Assets/2D/bevy_life.png 68K ./Apps/Games/bounce-up.png 68K ./Apps/Games/build_a_better_buddy.png 68K ./Assets/Helpers/bevy_plot.png 68K ./Assets/Helpers/bevy_proto.png 72K ./Apps/Games/not-snake.png 96K ./Apps/Tools/nodus.gif 104K ./Assets/Networking/ggrs_logo.png 124K ./Apps/Games/unflock.png 124K ./Assets/Shapes/bevy_smud.png 152K ./Assets/2D/bevy_tileset.gif 164K ./Learning/minesweeper-tutorial.png 172K ./Apps/Games/nbody_moon_creator.gif 172K ./Learning/Learn-Bevy-Ecs-By-Ripping-Off.png 176K ./Apps/Games/cheaters-never-win.png 216K ./Apps/Games/super-kaizen-overloaded.png 256K ./Apps/Games/bevy-tetris-yat.gif 276K ./Apps/Games/limbo_pass.png 328K ./Assets/Animation/bevy_easings.gif 384K ./Assets/Animation/bevy_tweening.gif 392K ./Apps/Games/bavy-balls.png 432K ./Apps/Tools/fun-notation.gif 540K ./Apps/Games/mechaburro.gif 692K ./Apps/Games/miner.png 704K ./Assets/2D/bevy-parallax.gif 776K ./Assets/3D/bevy_hanabi.gif 1.2M ./Apps/Games/bevy_combat.gif 1.5M ./Assets/Helpers/bevy_match3.gif 2.6M ./Assets/3D/bevy-hikari.gif 3.0M ./Apps/Games/Kataster.gif 4.1M ./Assets/2D/bevy_ecs_ldtk.gif |
I think we should combine this with some form of pagination to avoid needing to load absolutely everything at once. I don't know if that's possible without using a backend though. |
It's highly compressed, but it is also quite big (in area) for a thumbnail, so a smaller one with higher quality image should be of comparable size. EDIT: |
Oh, actually, the use of zola's |
Yes, the issue is with GIFs, everything else (🤞 ) is handled by Zola. (see: images macro). |
In the |
From what I remember the issue with GIFs is that the animation is lost and only the first frame is used when processed via Although… I just realized, maybe is just a matter of forcing the |
Nope, forcing |
That sounds like a bug in upstream? |
Yeah, I looked at the zola code, it uses two dependencies for image formatting:
|
Google provides example C code to convert gifs to webp here: https://chromium.googlesource.com/webm/libwebp/+/0.4.0/examples/gif2webp.c Wonder how easy it is to translate to rust using |
An easy temporary solution to improve the situation would be to set |
I'm on board with that as a start. @TimJentzsch can you make a PR? |
Sure :) |
This is a first step to improve the performance on the asset page (#361). The card images are now lazily loaded, meaning that images are only loaded once they are in the viewport of the user.
Assets page GIFs take around 16mb (at the time of writing this) and unfortunately don't get optimized by Zola
resize_image
(see issue #339 & PR #360). Ideally these should be resized to fit in340x340
(current assets thumbnail size) and converted to a better image format (e.g. webp, gifv, mpeg…)Ideally this should be automated.
ffmepg
could be used as it supports gif => webp.The text was updated successfully, but these errors were encountered: