coderai90 commited on
Commit
81cd9e0
·
verified ·
1 Parent(s): 9db4f99

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Using a placeholder image URL
9
+ url = "https://images.pexels.com/photos/1323550/pexels-photo-1323550.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2" # Replace with your actual image URL when available
10
+ response = requests.get(url)
11
+ image = Image.open(BytesIO(response.content))
12
+
13
+ st.image(image, caption='Apple Image', use_container_width=True)
14
+
15
+ st.sidebar.title("Image Adjustments")
16
+
17
+ # Example adjustments
18
+ brightness = st.sidebar.slider('Brightness', 0.5, 3.0, 1.0)
19
+ contrast = st.sidebar.slider('Contrast', 0.5, 3.0, 1.0)
20
+
21
+ if st.button('Apply Adjustments'):
22
+ img_enhanced = ImageEnhance.Brightness(image).enhance(brightness)
23
+ img_enhanced = ImageEnhance.Contrast(img_enhanced).enhance(contrast)
24
+ st.image(img_enhanced, caption='Enhanced Image', use_container_width=True)