Outputting Image with Python Library

Hello,

I am trying to simply output an image via the HDMI port. Here’s my code:

from pynq.overlays.base import BaseOverlay
from pynq.lib.video import *
import PIL.ImageDraw as ImageDraw
import PIL.Image as Image
import numpy as np
base = BaseOverlay(“base.bit”)

hdmi_out = base.video.hdmi_out
Mode = VideoMode(1920,1080,24)
hdmi_out.configure(Mode,PIXEL_RGB)

hdmi_out.start()

image = Image.open(‘base/video/orig.jpg’)

hdmi_out.writeframe(image)

I get the following error:

AttributeError: ‘JpegImageFile’ object has no attribute ‘flush’

I have tried converting into a numpy array, but that doesn’t seem to work either. Any ideas?

I think you should check more examples PYNQ/opencv_filters_hdmi.ipynb at image_v2.6.0 · Xilinx/PYNQ · GitHub

Thanks for responding.

I went and took a look at that example again.

I don’t want to capture anything from the HDMI input. I want to pass an image for output. The examples all involve using a webcam or some other device to capture a frame. Is there a way to do this or must the HDMI input be used? An example would be extremely helpful.

Is there any example somewhere that shows how to take a pre-existing static image and pass it to HDMI out?