Skip to content

Convert most tutorial assets to WEBP #3374

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

Merged
merged 4 commits into from
Mar 28, 2025

Conversation

damusss
Copy link
Member

@damusss damusss commented Mar 6, 2025

Starting from: #3362 (comment), #3362

I converted almost all tutorial assets to lossless WEBP using ffmpeg. Here are the details:

TOTAL SAVED BYTES: 429970

(1.47MB->1.06MB)

Not converted: Every jpg file (webp is larger), AdvancedInputOutput5.gif (webp was a few bytes larger)

Original File Original Size (bytes) New Size (bytes) Saved Bytes
AdvancedInputOutput1.gif 5649 2690 -2959
AdvancedInputOutput2.gif 72233 64812 -7421
AdvancedInputOutput3.gif 6294 2354 -3940
AdvancedInputOutput4.gif 29185 27158 -2027
AdvancedOutputAlpha1.gif 14915 5690 -9225
AdvancedOutputAlpha2.gif 71819 65024 -6795
AdvancedOutputAlpha3.gif 30380 25066 -5314
AdvancedOutputProcess1.gif 15951 6824 -9127
AdvancedOutputProcess2.gif 1868 622 -1246
AdvancedOutputProcess3.gif 1912 626 -1286
AdvancedOutputProcess4.gif 14500 6140 -8360
AdvancedOutputProcess5.gif 16896 15766 -1130
AdvancedOutputProcess6.gif 34058 31288 -2770
Bagic-INPUT-resultscreen.png 5973 3724 -2249
Bagic-INPUT-sourcecode.png 77061 32280 -44781
Bagic-ouput-result-screen.png 4819 2908 -1911
Bagic-PROCESS-resultscreen.png 5348 3194 -2154
Bagic-PROCESS-sourcecode.png 66070 27278 -38792
Basic-ouput-sourcecode.png 57466 25636 -31830
chimpshot.gif 46010 28298 -17712
introduction-Battleship.png 165586 110422 -55164
introduction-PuyoPuyo.png 31388 18040 -13348
introduction-TPS.png 136031 95120 -40911
intro_ball.gif 5015 3588 -1427
premultiplied_alpha_composition.png 10491 4524 -5967
straight_alpha_composition.png 10119 4270 -5849
surfarray.png 50836 38938 -11898
surfarray_allblack.png 125 42 -83
surfarray_flipped.png 50835 38804 -12031
surfarray_redimg.png 23443 15926 -7517
surfarray_rgbarray.png 50897 38938 -11959
surfarray_scaledown.png 15109 12840 -2269
surfarray_scaleup.png 67759 47414 -20345
surfarray_soften.png 47540 34530 -13010
surfarray_striped.png 392 52 -340
surfarray_xfade.png 41834 30274 -11560
tom_basic.png 5139 4522 -617
tom_event-flowchart.png 5528 2670 -2858
tom_formulae.png 6763 2626 -4137
tom_radians.png 17409 9758 -7651

@damusss damusss added the docs label Mar 6, 2025
@damusss damusss requested a review from Starbuck5 March 6, 2025 15:36
@damusss damusss requested a review from a team as a code owner March 6, 2025 15:36
@Matiiss
Copy link
Member

Matiiss commented Mar 6, 2025

What about jpeg vs lossy webp? If lossy webp files are smaller, then I suppose the only concern might be the resulting quality after converting an already lossy format to another lossy format, but maybe it's fine.

Copy link
Member

@Starbuck5 Starbuck5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a saving of 314 kb, nice!

Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR 👍

@Starbuck5 Starbuck5 merged commit 68d74aa into pygame-community:main Mar 28, 2025
1 check passed
@Starbuck5 Starbuck5 added this to the 2.5.4 milestone Mar 28, 2025
@damusss damusss deleted the tutorial-assets-webp branch May 12, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants