Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from PIL import Image, ImageEnhance
|
3 |
+
import requests
|
4 |
+
from io import BytesIO
|
5 |
+
|
6 |
+
st.title("Apple Image Playground")
|
7 |
+
|
8 |
+
url = "https://images.unsplash.com/photo-1568702846914-96b305d2aaeb?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" # Replace with your actual image URL
|
9 |
+
response = requests.get(url)
|
10 |
+
image = Image.open(BytesIO(response.content))
|
11 |
+
|
12 |
+
st.image(image, caption='Apple Image', use_container_width=True)
|
13 |
+
|
14 |
+
st.sidebar.title("Image Adjustments")
|
15 |
+
|
16 |
+
# Example adjustments
|
17 |
+
brightness = st.sidebar.slider('Brightness', 0.5, 3.0, 1.0)
|
18 |
+
contrast = st.sidebar.slider('Contrast', 0.5, 3.0, 1.0)
|
19 |
+
|
20 |
+
if st.button('Apply Adjustments'):
|
21 |
+
img_enhanced = ImageEnhance.Brightness(image).enhance(brightness)
|
22 |
+
img_enhanced = ImageEnhance.Contrast(img_enhanced).enhance(contrast)
|
23 |
+
st.image(img_enhanced, caption='Enhanced Image', use_container_width=True)
|