forked from emilevs/label_printer
12 lines
294 B
Python
12 lines
294 B
Python
from PIL import Image
|
|
|
|
def format_image(path):
|
|
image = Image.open(path)
|
|
image = image.rotate(-90, expand=True)
|
|
|
|
new_image = Image.new('1', (512, image.height), 1)
|
|
new_image.paste(image, (0, 0))
|
|
|
|
return new_image
|
|
|
|
#format_image("static/text/text.png").save("output.png")
|