A newer version of the Gradio SDK is available:
5.25.0
metadata
title: imgBlur
emoji: 🖼️
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.23.1
app_file: app.py
pinned: false
Image Blur Effects with Gaussian and Lens Blur
Welcome to imgBlur
, a Hugging Face Space that applies blur effects to images using Gaussian and lens blur techniques. This app uses machine learning models to separate foreground and background (for Gaussian blur) or estimate depth (for lens blur), creating professional-looking blur effects.
Try the App
You can use the app directly on Hugging Face Spaces: https://huggingface.co/spaces/Perghect/imgBlur
How to Use the App
- Upload an Image: Click the "Upload Image" box to upload an image from your device.
- Choose a Blur Type:
- Gaussian Blur: Uniformly blurs the background while keeping the foreground sharp.
- Lens Blur: Applies a depth-based blur, simulating a depth-of-field effect (closer objects are sharp, farther objects are blurred).
- Adjust Parameters:
- For Gaussian Blur, use the "Gaussian Blur Sigma" slider to control blur intensity (higher values = more blur).
- For Lens Blur, use the "Max Blur Radius" slider to control the maximum blur intensity and the "Foreground Percentile" slider to adjust the depth threshold for the foreground.
- Apply the Blur: Click the "Apply Blur" button to process the image.
- View the Result: The processed image will appear in the "Output Image" box, along with a description of the effect applied.
Example: Try uploading an image with a clear foreground and background (e.g., a person in front of a landscape) to see the effects in action.
Run the App Locally
If you’d like to run this app on your own machine or modify the code, follow these steps:
Prerequisites
- Python 3.8 or higher
- Git
- A machine with a GPU (recommended for faster processing, though CPU works too)
Steps
- Clone the Repository:
git clone https://huggingface.co/spaces/Perghect/imgBlur cd imgBlur