Displaying image at the same place
See original GitHub issueSummary
Hi all, I try to make when the st.image(new_image) is called, the place where it display is the same as the st.image(old_image). In other word, the new_image replace the old_image (only display one image) instead of display both the new_image and old_image.
Steps to reproduce
I have the following function:
def main():
st.image(old_image)
if st.checkbox("New Layer"):
st.image(new_image)
When I click the “checkbox”, it displays a new image underneath the old_image. However, I want to display “new_image” and not “old_image” anymore.
I’d appreciate any suggestions!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
How do I position one image on top of another in HTML?
The easy way to do it is to use background-image then just put an <img> in that element ...
Read more >How To Align Images Side By Side - W3Schools
How To Place Images Side by Side. Step 1) Add HTML: ... Step 2) Add CSS: How to create side-by-side images with the...
Read more >Method for making image stay in same position? - HTML & CSS
The idea here is that by putting them together in the element, it will position the bubble in relation to its container, keeping...
Read more >How to Align and Float Images with CSS | Web Design
Aligning images will only position the image left, right, or center with the text ... This is good for displaying images like a...
Read more >What is the process for placing two images next to each other ...
Two images inside the same container will normally display as inline unless the combined width is greater than the container or something in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You should create an empty placeholder instead of an image:
imageLocation = st.empty()
Then you can edit the content in this same location however you want (Even change it from an image to a graph, video or anything else!)
Awesome, thank you very much! I want to make a quick update just for future reference. imageLocation = st.empty() . . imageLocation.image(old_image) # no need extra “st.”