Answers for "im save to a bytes io python"

0

im save to a bytes io python

from io import BytesIO
from PIL import Image, ImageDraw

image = Image.new("RGB", (300, 50))
draw = ImageDraw.Draw(image)
draw.text((0, 0), "This text is drawn on image")

byte_io = BytesIO()

image.save(byte_io, 'PNG')
Posted by: Guest on August-11-2020

Python Answers by Framework

Browse Popular Code Answers by Language