From 8823936fc2fe185d27729e2d073609dd25ea73b4 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sat, 19 Jun 2021 18:16:51 -0400 Subject: [PATCH] Change to ppm format from png to get better performance --- DemoPrograms/Demo_OpenCV_Draw_On_Webcam_Image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DemoPrograms/Demo_OpenCV_Draw_On_Webcam_Image.py b/DemoPrograms/Demo_OpenCV_Draw_On_Webcam_Image.py index 07a1b964..dd14bb91 100644 --- a/DemoPrograms/Demo_OpenCV_Draw_On_Webcam_Image.py +++ b/DemoPrograms/Demo_OpenCV_Draw_On_Webcam_Image.py @@ -23,7 +23,7 @@ def main(): break ret, frame = cap.read() - imgbytes=cv2.imencode('.png', frame)[1].tobytes() + imgbytes=cv2.imencode('.ppm', frame)[1].tobytes() if a_id: graph_elem.delete_figure(a_id) # delete previous image a_id = graph_elem.draw_image(data=imgbytes, location=(0,0)) # draw new image @@ -34,4 +34,4 @@ def main(): window.close() -main() +main() \ No newline at end of file