A simple Streamlit application that allows users to upload images, convert them to grayscale, generate histograms, and apply basic image filters like contrast enhancement or histogram equalization.
This app is a simple yet powerful demonstration of image processing using Python, Streamlit, and Pillow.
It provides an intuitive interface to:
- Upload images
- Convert them to grayscale
- Visualize histograms of pixel intensities
- Apply basic filters like contrast enhancement or histogram equalization
Feature | Description |
---|---|
Image Upload | Supports JPG, JPEG, and PNG formats. |
Grayscale Conversion | Converts uploaded image to grayscale using Pillow's ImageOps.grayscale() method. |
Histogram Generation | Displays a histogram of pixel intensities using Matplotlib. |
Image Filters | Includes options for contrast enhancement or histogram equalization. |
Clone the repository and set up your environment to run the app.
Before running this application, make sure you have the following installed:
- Python 3.8+
- Streamlit (
pip install streamlit
) - Pillow (
pip install pillow
) - Matplotlib (
pip install matplotlib
) - Numpy (
pip install numpy
)
You can install all dependencies with:
pip install streamlit pillow matplotlib numpy
or run the provided requirements.txt
file.
-
Clone the repository (or download it as a ZIP):
git clone https://github.com/your-repo-url.git
-
Navigate to the project directory:
cd image-to-grayscale-converter
To run the app, use the following command in your terminal:
streamlit run app.py
This will start a local development server and open the Streamlit app in your browser.
- Upload an image file (JPG, JPEG, or PNG).
- The original image is displayed alongside its grayscale version.
- A histogram of pixel intensities is shown for the grayscale image.
- You can apply filters like enhance or equalize to further process the image.
Here's a quick overview of how the app works:
grayify-eq-enh-filter.mp4
- Streamlit – For creating the web interface.
- Pillow – For handling and manipulating images.
- Matplotlib – For generating histograms.
- Numpy – For array operations.
This project is licensed under the MIT License - see LICENSE file for details.