PIL and pygame.image

Sadly the accepted answer doesn’t work anymore, because Image.tostring() has been removed. It has been replaced by Image.tobytes(). See Pillow – Image Module. Function to convert a PIL Image to a pygame.Surface object: def pilImageToSurface(pilImage): return pygame.image.fromstring( pilImage.tobytes(), pilImage.size, pilImage.mode).convert() It is recommended to convert() the Surface to have the same pixel format as the … Read more

How can I install PIL on mac os x 10.7.2 Lion

If you use homebrew, you can install the PIL with just brew install pil. You may then need to add the install directory ($(brew –prefix)/lib/python2.7/site-packages) to your PYTHONPATH, or add the location of PIL directory itself in a file called PIL.pth file in any of your site-packages directories, with the contents: /usr/local/lib/python2.7/site-packages/PIL (assuming brew –prefix … Read more