save as png
This commit is contained in:
		@@ -27,9 +27,9 @@ def ascii_from_image(image: Image.Image, size: int = 128) -> str:
 | 
			
		||||
 | 
			
		||||
def save_image(image: Image.Image, path: str):
 | 
			
		||||
    if os.path.isdir(path):
 | 
			
		||||
        path = os.path.join(path, 'generated.jpg')
 | 
			
		||||
    elif not path.endswith('.jpg'):
 | 
			
		||||
        path += '.jpg'
 | 
			
		||||
        path = os.path.join(path, 'generated.png')
 | 
			
		||||
    elif not path.endswith('.png'):
 | 
			
		||||
        path += '.png'
 | 
			
		||||
    print("saving image to", path)
 | 
			
		||||
    image.save(path)
 | 
			
		||||
    return image
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user