Open PySimpleGUI opened 3 years ago
Ah, I thought only png format was supported :) When I change it to ".ppm" as you mentioned, the image and the interface in generally run smoother. Thank you for your help.
Great!
A user pointed out this optimization. I haven't added it to all of the demos yet as there is a problem when using the Web port, so I wanted to make sure that I properly commented or added checks to the code. For OpenCV projects, try ppm in the future and see if you continue to get good performance.
https://github.com/cenkakay08/Webcam-GUI-with-PySimpleGUI/blob/f02015c95999b629b23a03cda1b9a152be47d4e9/main.py#L95
A PySimpleGUI user suggested using the ppm format rather than png in the PySimpleGUI Demos that are for opencv. This statement in particular is what is changed to use ppm:
I've found that it had a dramatic impact on my CPU usage. The reason I didn't immediately roll it out into all of the opencv demo programs is that it worked on all of them, except when the demo was run with the PySimpleGUIWeb port. I need to add some explanation to the demos to explain this situation so it wasn't as simple as changing the line of code, unfortunately. I'll bump up the priority of this since I'm seeing more opencv projects.
If you change it, lemme know if it helps you.