Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
import streamlit as st
|
| 3 |
from PIL import Image, ImageOps, ImageFilter, ImageEnhance
|
| 4 |
import io
|
|
|
|
| 5 |
|
| 6 |
st.set_page_config(page_title="Image Filter App", layout="wide")
|
| 7 |
|
|
@@ -121,3 +122,16 @@ if uploaded_file:
|
|
| 121 |
else:
|
| 122 |
st.info("Select a filter to see output.")
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import streamlit as st
|
| 3 |
from PIL import Image, ImageOps, ImageFilter, ImageEnhance
|
| 4 |
import io
|
| 5 |
+
import os
|
| 6 |
|
| 7 |
st.set_page_config(page_title="Image Filter App", layout="wide")
|
| 8 |
|
|
|
|
| 122 |
else:
|
| 123 |
st.info("Select a filter to see output.")
|
| 124 |
|
| 125 |
+
with col1:
|
| 126 |
+
if filtered_image:
|
| 127 |
+
# Prepend "DEEZ_" to the original file name
|
| 128 |
+
file_name = uploaded_file.name
|
| 129 |
+
file_name_with_prefix = "DEEZ_" + file_name
|
| 130 |
+
|
| 131 |
+
# Allow downloading the filtered image with the modified name
|
| 132 |
+
st.download_button(
|
| 133 |
+
label="Download Filtered Image",
|
| 134 |
+
data=filtered_image.tobytes(),
|
| 135 |
+
file_name=file_name_with_prefix,
|
| 136 |
+
mime="image/png"
|
| 137 |
+
)
|