# Adding drawing on webcam image

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadding-drawing-on-webcam-image%2F34600%3E%5C
**Category:** 🔒 Gradio\
**Created:** [March 24, 2023, 10:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadding-drawing-on-webcam-image%2F34600 "2023-03-24T22:09:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zivpollak](https://avatars.discourse-cdn.com/v4/letter/z/96bed5/32.png) [@zivpollak](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fzivpollak)%5C
**Post date:** [March 24, 2023, 10:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadding-drawing-on-webcam-image%2F34600%2F1 "2023-03-24T22:10:00Z")

</div>

Hi,

I’m trying to display a live video stream from the webcam while adding a rectangle on the image, using Blocks.

So this is what I have:

Def draw(im):  
cv2.rectangle(im,(50,50), (200,200), (0, 255, 255), 2)  
return im

with gr.Blocks() as demo:  
inp = gr.Image(source=“webcam”, shape=(250,250), streaming=True)  
out = gr.Image(label=‘Out-Calibration’, )  
inp.change(draw, inp, out)

This works and does what I expect it to do, but the output image is flickering, which is annoying.

Am I doing something wrong here? is there a better way to do this?

Thanks!
