Hi,
I am trying to display an image with plotly_chart on my streamlit app that is running locally.
The user inputs change the size of the image and for certain parameters the image won’t be displayed anymore.
I think that it is link to the size of the image and to test that I made a simple demonstrator of the problem:
import streamlit as st
import plotly.express as px
import numpy as np
def main() -> None:
st.set_page_config(layout="wide")
st.title("Test imshow")
st.write("Test of displaying an image using plotly in streamlit.")
x = st.number_input("x", 10, 10000, 100)
y = st.number_input("y", 10, 10000, 100)
image = np.random.random((x, y))
plot = st.empty()
im = px.imshow(image, aspect='auto')
with plot:
st.plotly_chart(im)
When I choose x = 2000 and y > 1400 (more or less), the image is no longer displayed (no error message, just “:”).
I’ve tried increasing the maximum message or file size to 500 MB, 1 GB or more, but it doesn’t make any difference.
I’ve tried changing these settings in the streamlit code, with or without a reboot, nothing changes.
I’ve seen several old posts on this subject but in the end none of them helped me.
If you can give me a hand, thank you!