kivy display pil image

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

showing results for - "kivy display pil image"
Edoardo
27 Jan 2021
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