How to import jpg/png into a pycharm???

I have struggled with this and find more frustration than answers.  I want to import simple graphics (jpg/png) into pycharm (community edition) so that they are displayed in the console when you run the code.  

Here is what I tried :

import Image

image = Image.open('Tulips.jpg')
image.show()

This didn't work, so another answer would be greatly appreciated.  If this code is non-sense, please disregard. 

What is the best STEP by STEP method of doing this please?

1
8 comments
Avatar
Permanently deleted user

The image file must be in the directory you're running your program

1
Avatar
Permanently deleted user

I need help with this and the above coment is exactly the stuff i see. "Download to a file", please walk me through the process step by step or i won't know what your talking about.. I'm at my end and near giving up because nobody will explain in detail. Please don't tell me to click and drag... just want to add png file to my project list..

0

Hello, 

 

Please try

 

from PIL import Image

image = Image.open('Tulips.jpg')
image.show()

Let me know what is the error. 

0
Avatar
Permanently deleted user

hi am tying to import a png image which is not displayed. I get no error.

icon = pygame.image.load("ufo.png")
pygame.display.set_icon(icon)
0

Hi, i have been looking on the internet for hours, so please, give me an in-depth description on how to put an image on a webpage in html  

0

Yeah, I looked at another one and it says you just drag it in the project but it don't work

0
from turtle import *
Screen().bgpic("a.png")

 

0

Please sign in to leave a comment.