+ 1
How to add image in python
From starting
7 Réponses
+ 5
from PIL import Image
img = Image.open('image.jpg')
img.show()
+ 2
you have to use a Gui library like pygame,...
it's not possible in sololearn.
read about pygame and try it on your computer.
+ 2
Mirielle🐶 right, if you check my answer I said pygame and ... for other possibilities.
I suggested pygame for simplicity,
I'm not saying Pillow is not used in the solution.
the real issue here is the poster, he is not very accurate about what he needs.
if he just needs to open an image and show it with the system image viewer or show it in a window, sure pillow is the way to go.
but if he needs to put it (add it) in a window with other components, buttons, text fields... he would need some gui library not pygame necessarily, it's just a suggestion. and yes that library will use pillow.
by manipulate I meant process images in all kinds of ways.
I used PIL to write image filters for GIMP, before PIL development was stalled and moved to Pillow as a fork.
funny that you are talking about [behind the scenes and the use everywhere]
remember when I tried to say that about socket in python networking. but you were denying it, good times 😃
+ 2
Mirielle🐶 I agree with you, what i'm saying is there are things you can do with PIL alone and things that you need another library to complement PIL.
if you need to make a gui window with buttons and events and add an image somewhere in the window you need Gui library, yes it will include PIL or OpenCV...
the post title says add image to Python, and it depends on what the user means by that.
why use pygame or any other gui because it provides events and a window to interact with.
0
But why it is saying that module not found
https://www.sololearn.com/discuss/2134584/?ref=app