lordmauve / lordmauve/pgzero

Support webp, mp3 etc

Open
#341 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Python
Stars
611
Forks
211
PR merge metrics
No merged PRs in 30d

Description

Since [Pygame 2.0.0](https://github.com/pygame/pygame/releases/tag/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](https://github.com/lordmauve/pgzero/blob/main/src/pgzero/loaders.py#L175), but also tests.

I think the relevant set is:

- [X] 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](https://pypi.org/project/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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/pgzero/loaders.py, where the supported file extensions are listed, and inspect the existing tests for loader format support. Add coverage for the remaining MP3, FLAC, and 32-bit WAV formats, then run those tests. Done means the supported formats work consistently with the Pygame versions targeted by the project.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
game-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.