Closed minhalvp closed 1 year ago
Thanks for this! Just FYI the SpriteSystem is no longer under active development (replaced by the revamped Renderer/Texture API), but I'm still happy to merge any improvements people offer.
I'm merging this into a temporary branch to fix a few things (add the change to news.rst
, add a unit test to make sure it the method still works if PIL isn't installed), but will make sure you get credited properly in the changelog 🙂
PR Description
A PIL.Image can be directly inputted to the
from_image
function which is found in spritesystem.py. This allows the user to input a PIL image (that has been initialized in the code) into thefrom_image
function instead of needing to save the image and load it.You can use an image from your code like this:
Instead of saving the image in your code and loading it which is slow. Like this:
Merge Checklist
closes #<issue-number>
to automatically close an issue