# Adding drawing on webcam image

**URL:** <https://discuss.huggingface.co/t/adding-drawing-on-webcam-image/34600>\
**Category:** 🔒 Gradio\
**Created:** [March 24, 2023, 10:09pm UTC](https://discuss.huggingface.co/t/adding-drawing-on-webcam-image/34600 "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](https://discuss.huggingface.co/u/zivpollak)\
**Post date:** [March 24, 2023, 10:10pm UTC](https://discuss.huggingface.co/t/adding-drawing-on-webcam-image/34600/1 "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!
