EuroPython / website

Repository for the EuroPython 2022+ website.
https://europython.eu
21 stars 60 forks source link

Losslessly compress PNGs #780

Open hugovk opened 3 days ago

hugovk commented 3 days ago

Some of the images on the website are much larger than they need to be, for example one of the of the sponsor logo images is 5692x3200 but displayed at 250x120!

All the sizes:

These should really be resized to something closer to their display size (the same applies to WEBP images). I've not done that here.

Instead, I've losslessly compressed the PNGs https://github.com/shssoichiro/oxipng (it's a multithreaded version of optiPNG to reduce their total size by about 15% from 93 MB to 79 MB, using the command git ls-files "*.png" | xargs oxipng -o max --strip all

24619 bytes (19.17% smaller): public/favicon.png
44673 bytes (29.65% smaller): public/img/eps-logo.png
499687 bytes (35.39% smaller): src/images/rooms/level-5-foyer.png
87298 bytes (18.24% smaller): public/social-card.png
338084 bytes (48.44% smaller): src/images/rooms/forum.png
118658 bytes (11.87% smaller): src/content/sponsors/kraken.png
464113 bytes (52.19% smaller): src/images/rooms/liffey-hall-1.png
155930 bytes (20.81% smaller): public/social_card_remote.png
219563 bytes (48.57% smaller): src/images/rooms/ground-floor-foyer.png
553604 bytes (53.35% smaller): src/images/rooms/level-1-foyer.png
419777 bytes (51.24% smaller): src/images/rooms/liffey-a.png
178127 bytes (46.36% smaller): src/images/rooms/level-2-foyer.png
7878246 bytes (14.14% smaller): src/content/deadlines/hall_rotated.png
41995 bytes (65.67% smaller): src/content/sponsors/packt.png
494986 bytes (52.66% smaller): src/images/rooms/liffey-hall-2.png
434471 bytes (13.21% smaller): src/images/rooms/liffey-meeting-room-2.png
486164 bytes (52.58% smaller): src/images/rooms/liffey-boardroom-3.png
406887 bytes (51.34% smaller): src/images/rooms/liffey-boardroom-4.png
357845 bytes (51.47% smaller): src/images/rooms/wicklow-hall-1.png
1046941 bytes (42.93% smaller): src/images/rooms/level-3-foyer.png
44905 bytes (29.35% smaller): public/img/eps-logo-white.png
55288 bytes (72.30% smaller): src/content/pages/images/accessibility-references.png
239026 bytes (19.63% smaller): public/sponsor-swag/googlecloud-swag.png
268126 bytes (49.05% smaller): src/images/rooms/wicklow-hall-2.png
280206 bytes (49.28% smaller): src/images/rooms/ecocem.png
1359849 bytes (6.36% smaller): src/content/pages/images/accessibility-first-floor-map.png
413331 bytes (31.50% smaller): src/content/pages/images/accessibility-second-floor-map.png
1450394 bytes (25.70% smaller): src/content/pages/images/accessibility-map.png
752276 bytes (15.28% smaller): public/sponsor-swag/numberly-swag-0.png
2868132 bytes (13.47% smaller): src/content/pages/images/sprints-collage24.png
1071445 bytes (7.28% smaller): src/content/pages/images/accessibility-ground-floor-map.png
816263 bytes (11.23% smaller): src/content/pages/images/accessibility-parking-map.png
5650859 bytes (14.16% smaller): public/sponsor-swag/numberly-swag-1.png
26861661 bytes (7.31% smaller): src/images/cards/volunteers-23.png
26861661 bytes (7.31% smaller): src/content/deadlines/volunteers-24.png
vercel[bot] commented 3 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ep2024 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 4, 2024 10:23am
patrick91 commented 3 days ago

@hugovk mmh, I don't think this would change much, since we are using Astro to optimise the images

Not sure why it is not resizing the sponsor ones well though 🤔

patrick91 commented 3 days ago

should be fixed after merging this: https://github.com/EuroPython/website/pull/781

patrick91 commented 3 days ago

I think we could close this, I don't think we need to optimise the source images, unless we want to save space on the git repo (but then we'd need to purge the previous images from the history too), what do you think?

hugovk commented 3 days ago

Larger files are still being served, even after merging #781.

I checked two files from the website (favicon.png and social-card.png) and they're still the bigger sizes (30k and 104k) rather than the smaller ones in this PR (24K and 85k).

patrick91 commented 3 days ago

@hugovk which ones?

for favicon and social, we can update them 😊

hugovk commented 3 days ago

These ones:

https://ep2024.europython.eu/favicon.png https://ep2024.europython.eu/social-card.png