lordmauve/pgzero

Support webp, mp3 etc

Open

#341 创建于 2025年4月1日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Python (472 star) (185 fork)batch import
good first issue

描述

Since Pygame 2.0.0 Pygame has supported a wider range of formats including webp for images and mp3 for audio.

pgzero initially restricted support for mp3 in order to ensure cross-platform compatibility.

We can now relax this and add support for more of the image and audio formats supported in Pygame. This will only require changes to the file extensions listed in loaders.py, but also tests.

I think the relevant set is:

  • WebP images
  • MP3 audio
  • FLAC audio
  • 32-bit WAV

Others (PNM, TIFF) are niche.

SVG is available in Pygame but the implementation (nanosvg) has major limitations, with no support for text rendering, gradients, filers, or antialiasing. resvg_py would be a better implementation for this, more complete and more stable. But the project doesn't look very mature. Because it uses unstable ABI wheels it would become uninstallable on newer interpreters if maintenance dried up.

贡献者指南