How to use an image from a file as a background for a canvas
I've been trying the following:
from PIL import Image
im = Image.open("./myfile.jpg")
image = im.tobitmap()
I keep getting the error on the line calling tobitmp: "ValueError: Not a bitmap"
What am I doing wrong?
import canvas, clipboard, Image pil_image = Image.open('my_photo.png') clipboard.set_image(pil_image, format='png') canvas.set_size(*pil_image.size) canvas.draw_clipboard(0,0,*pil_image.size)
There must be a way to do this without the clipboard but it was beyond me.
Thanks, this worked!
I tried used one of the online converters to convert an image from jpg to bmp, but when I tried to use it with canvas.draw_image, it claimed that the bitmap compression wasn't supported. So, bottom line, I haven't yet been successful in getting draw_image() to work.