# Outputting Image with Python Library

**URL:** <https://discuss.pynq.io/t/outputting-image-with-python-library/1979>\
**Category:** Support\
**Created:** [November 1, 2020, 9:11pm UTC](https://discuss.pynq.io/t/outputting-image-with-python-library/1979 "2020-11-01T21:11:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitmeddler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/bitmeddler/32/1418_2.png) [@bitmeddler](https://discuss.pynq.io/u/bitmeddler)\
**Post date:** [November 1, 2020, 9:11pm UTC](https://discuss.pynq.io/t/outputting-image-with-python-library/1979/1 "2020-11-01T21:11:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [November 2, 2020, 5:35pm UTC](https://discuss.pynq.io/t/outputting-image-with-python-library/1979/2 "2020-11-02T17:35:59Z")

</div>

I think you should check more examples [PYNQ/opencv\_filters\_hdmi.ipynb at image\_v2.6.0 · Xilinx/PYNQ · GitHub](https://github.com/Xilinx/PYNQ/blob/image_v2.6.0/boards/Pynq-Z1/base/notebooks/video/opencv_filters_hdmi.ipynb)

---

<div class="post-metadata">

**Author:** ![bitmeddler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/bitmeddler/32/1418_2.png) [@bitmeddler](https://discuss.pynq.io/u/bitmeddler)\
**Post date:** [November 2, 2020, 7:11pm UTC](https://discuss.pynq.io/t/outputting-image-with-python-library/1979/3 "2020-11-02T19:11:19Z")

</div>

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?
