title: Streamlit image download button
body: <pre><code>st.write(&quot;Preview&quot;)
  #openCV image result cropped_image which is an np array
  st.image(cropped_image)
  #cropped_image converted to PIL image color      
  result = Image.fromarray(cropped_image.astype('uint8'), 'RGB')
      
  img = Image.open(result)            
  
  btn = st.download_button(
        label=&quot;Download image&quot;,
        data=img,
        file_name=&quot;imagename.png&quot;,
        mime=&quot;image/png&quot;)
       
  </code></pre>
  <p>I want to use st.download_button to download the image result. I know I cannot use the cropped_image result since it is an np array. I converted the image array to a PIL image but I don't know how I can get the result image filename from here . Could you please give me some ideas how to solve this issue?</p>