Home > other >  Python load PNG image warning libpng warning: iCCP: known incorrect sRGB profile solution
Python load PNG image warning libpng warning: iCCP: known incorrect sRGB profile solution

Time:01-22

Pygame game programming after load PNG image always prompt warning, although does not affect the operation, but the impact to debug, trouble, a a modified ps picture directly to a piece of code to solve the problem
The import pygame
The import OS
Pygame. The init ()
Path="../"
For root, dirs, files in OS. Walk (path) :
Print (root)
For the name in files:
Print (name)
If the name. Endswith (" PNG ") :
Newimages=pygame. Image. The load (name)
Pygame. Image. Save (newimages, name)
  • Related