File size: 941 Bytes
81cd9e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as st
from PIL import Image, ImageEnhance
import requests
from io import BytesIO

st.title("Apple Image Playground")

# Using a placeholder image URL
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
response = requests.get(url)
image = Image.open(BytesIO(response.content))

st.image(image, caption='Apple Image', use_container_width=True)

st.sidebar.title("Image Adjustments")

# Example adjustments
brightness = st.sidebar.slider('Brightness', 0.5, 3.0, 1.0)
contrast = st.sidebar.slider('Contrast', 0.5, 3.0, 1.0)

if st.button('Apply Adjustments'):
    img_enhanced = ImageEnhance.Brightness(image).enhance(brightness)
    img_enhanced = ImageEnhance.Contrast(img_enhanced).enhance(contrast)
    st.image(img_enhanced, caption='Enhanced Image', use_container_width=True)