Jelle Feringa wrote: > My guess was that pilmage.tostring() would be quite similar to pygame's > pygame.image.tostring(img, "RGB") function. That unfortuanately isn't the > case.
judging from the pygame documentation, they do the exact same thing (but with slightly different arguments). according to the documentation, the following should work: mode = image.mode size = image.size data = image.tostring() assert mode in "RGB", "RGBA" surface = pygame.image.fromstring(data, size, mode) (and you could probably use frombuffer instead of fromstring). > When I use the PIL function to encode to a string, the program crashes after > a couple of frames, and works fine with the pygame string function. it crashes and works fine? how does it crash? traceback? coredump? what crashes and what works? </F> _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig