Pygame PNG Image Looks Corrupt
I'm following this guide to try and display a basic PNG image inside a Pygame window. My image is a simple 150x150 green ball with no transparency called ball.png, located in the s
Solution 1:
As @DJ McGoathem said, Pygame has known issues with El Capitan due to differing versions of the SDL_image
library; Pygame needs version 1.2.10 but El Capitan has 1.2.12. This can be solved by downgrading this library, which I did like this (requires Brew):
- Copy this code into a file called
sdl_image.rb
- Open a Terminal inside the directory where you saved that file
- Run
brew remove sdl_image
to uninstall the incompatible version of the library - Run
brew install -f sdl_image.rb
to install the compatible version of the library
After this, my program was rendering the image correctly.
Post a Comment for "Pygame PNG Image Looks Corrupt"