py-sdl / py-sdl2

Python ctypes wrapper around SDL2
Other
296 stars 49 forks source link

Rewrite and redocument the sdl2.ext.image API #205

Closed a-hurst closed 2 years ago

a-hurst commented 2 years ago

PR Description

This PR deprecates the sdl2.ext.load_image function (which returned inconsistent SDL surface types depending on the back end used), and adds the new functions sdl2.ext.load_bmp and sdl2.ext.load_img to take its place.

This also adds a new function sdl2.ext.save_bmp for saving SDL surfaces as BMP files, as well as another function sdl2.ext.pillow_to_surface for converting PIL Image.Image() objects into SDL surfaces.

Merge Checklist