Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libpng warning: interlace handling should be turned on when using png_read_image in Python/PyGame

I'm using PyGame for Python, and have been receiving the following warning when loading .png images with pygame.image.load:

libpng warning: Interlace handling should be turned on when using png_read_image

It doesn't affect the program, but has become particularly annoying. I've scoured the web for an answer to no avail.

I'm currently using 32 bit Python 3.3 with PyGame 1.9.2

Any ideas as to how I can get the warning to disappear?

like image 200
Julian Laval Avatar asked Oct 20 '12 16:10

Julian Laval


2 Answers

I had the same problem. It seems to be some bug of older libpng versions (see http://sourceforge.net/p/libpng/bugs/165/ for detail).

It should be already fixed, but not in my current setup: win32 + python 2.7.3.

As a workaround I simply converted png-24 images to png-8 in Photoshop and message has disappeared.

like image 121
JirkaV Avatar answered Sep 18 '22 12:09

JirkaV


I can confirm that I was having this same issue using Pygame 1.9.6 with Python 3.7.4.

I was able to fix it by downloading Python 3.8 from https://www.python.org/ and installing Pygame 2.0.0.dev6 by doing a quick

python -m pip install Pygame>=2.0.0.dev6

althoug you might be able to get it to work with a version in between the ones I mentioned.

like image 28
user2113 Avatar answered Sep 21 '22 12:09

user2113