Spaces:
Sleeping
Sleeping
File size: 948 Bytes
c941979 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import streamlit as st
from PIL import Image, ImageEnhance
import requests
from io import BytesIO
st.title("Apple Image Playground")
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
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)
|