Pillow on mac not showing image - python

I have a hangman style program that calls on Pillows to display images, but instead it just opens a python process as depicted in the images while displaying nothing:
I've installed Pillows successfully, and running the program on a Windows PC with WinPy opens the image.

Related

Opencv opening an image or window launches Python at 99% CPU utilization

import cv2
img = cv2.imread("sample1.png")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
cv2.imshow("sample1.png", img)
cv2.waitKey(0)
cv2.destroyAllWindows()
When I run the above code on VSCode, I'm expecting a window to pop up to preview the image I have locally inside the script directory I made.
However, Python launches instead, with no window pop up, and just freezes the application. I am have to force quit the application, which from the Activity Monitor on Mac OS (Big Sur 11.1), shows it being 99% CPU utilized.
The same issue arises when I try to generate a simple window; the same Python application with the rocket icon opens and freezes.
Interestingly, if I run the code in IDLE, the preview and window pop-ups open normally.
Is this normal?

Display an Image with OpenCV doesn't work with my Mac

I am trying a simple Computer Vision program with OpenCV. After creating the Python file, I run it through Jupyter Lab directly on the Terminal to avoid bugs. However, it opens a python3 file (not an image) and I cannot see the image.
I have tried the following:
Step 1: Terminal
Step 2: File not responding
Do you have any clue why this is happening?

how do i get windows 7 to display results of running python and tkinter in a window or html doc

I am running windows 7. Python runs but I cannot seem to have the results shown on screen. It just seems to run in background.
I have tried to run through chrome and IE. The program runs from a shortcut on desktop, but does not show output.

Python Zelle graphics - image error

Using a mac, I am trying to set the background of my program to an image that i downloaded, I called the image "ChristmasBackground.jpg" and saved it to my documents. Using Zelle graphics, this is what I wrote:
XmasBack = Image(Point(600,100),"ChristmasBackground.jpg")
XmasBack.draw(win)
but the program is giving me an error saying:
couldn't open "ChristmasBackground.jpg": no such file or directory
just put it in the same folder of your script or write the file path

Pycharm, OpenCV execute on remote server and display Image locally

I set up PyCharm for remote debugging according to this tutorial on CodeProject
http://www.codeproject.com/Tips/987276/Remote-Programming-of-RaspberryPi-using-PyCharm
I am now wondering if it is possible to execute a Python Script with the help of PyCharm on the RaspberryPI and receive the output in PyCharm. Specifically I want to do some image processing and display the image with the help of OpenCV. It would be great to get the image displayed on my Windows machine, not on the Pi.
Another usecase, I want to create some matplot figure, execute the script on the pi and show the Output back in PyCharm on my Windows machine.
Is this possiple?
Kind Regards
You can do this using OpenCV Image Viewer Plugin. Debug you program using remote interpreter in Pycharm, stop at the breakpoint and choose "View as image".
https://plugins.jetbrains.com/plugin/14371-opencv-image-viewer
Disclaimer: I'm an author of this plugin

Categories

Resources