Skip to content

Instantly share code, notes, and snippets.

Last active Dec 31, 2018
What would you like to do?
Create temporary imagefile
import tempfile
from io import BytesIO
from PIL import Image
def get_test_image():
file = BytesIO()
image ='RGBA', size=(50, 50), color=(155, 0, 0)), 'png') = 'test_image.png'
return file
def get_temporary_image_name():
temp_file = tempfile.NamedTemporaryFile()
image ='RGBA', (200, 200), (255, 0, 0)), 'png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment