Image in Markdown

Hi everyone
For some reason, I have to use the image in markdown instead of st.image. However, it didn’t work. Do you know how can I do?

a = """Some text

![Cool Image](images/DWAFig22.png)

Some more text"""

st.markdown(a)

Hey @Berk_Demir,

Hard to say with just this snippet, do you have a link to a GitHub repo and can you screenshot the error you get when you try to use st.image()? (also please add the image code you use)

Happy Streamlit-ing!
Marisa

I am sorry, I think I wasn’t clear. I want to use markdown to show my image. not the st.image. The snippet I have sent you is a markdown text which is later on shwon in Streamlit as st.markdown(a). But, image does not appear.

It is shown as a broken link and the link is: http://localhost:4444/images/DWAFig22.png

Hello again. I have tried with online images and it works. However, images on my computer during localhost application does not work.

https://share.streamlit.io/akrolsmir/streamlit-snippet/main?snippet_id=3biYhJQ4

So you are trying to use markdown to display an image on your app that is stored in your local computer? Why do you want to use markdown instead of the st.image function?

What does your directory structure look like?

Based on the path you supply you have a /images/ folder in your current working directory and in that folder there should be a DWAFig22.png

can you screenshot the error you get?

1 Like