display pil image on kivy canvas

Solutions on MaxInterview for display pil image on kivy canvas by the best coders in the world

showing results for - "display pil image on kivy canvas"
Emely
12 Jan 2019
1from kivy.core.image import Image as CoreImage
2from kivy.uix.image import Image as kiImage
3from PIL import Image, ImageDraw, ImageFont
4from io import BytesIO
5
6canvas_img = Image.new('RGB', (240, 120), color=(255, 255, 255))
7(do stuff to canvas_img)
8data = BytesIO()
9canvas_img.save(data, format='png')
10data.seek(0) # yes you actually need this
11im = CoreImage(BytesIO(data.read()), ext='png')
12self.beeld = kiImage() # only use this line in first code instance
13self.beeld.texture = im.texture
14