Hi, I am new to Streamlit and I have a question about how can I display images on my website
You can use the
st.image() method to display your image.
Here’s a code snippet:
import streamlit as st
from PIL import Image
image = Image.open('sunrise.jpg')
st.image(image, caption='Sunrise by the mountains')
Note: Your image file (e.g. sunrise.jpg) is located in the same folder as your app file. If the image is inside a subdirectory then you can specify the folder name as part of the path as in
image = Image.open(‘path/to/sunrise.jpg’)
The above code snippet was taken from the Docs page for
Hope this helps!