Skip to content

Grayify is a Streamlit application that converts an uploaded image to grayscale and generates a histogram of pixel intensities. It also offers two filter options; Equalize (histogram equalization) and Enhance (contrast enhancement).

License

Notifications You must be signed in to change notification settings

pabs-code/grayify-equalize-enhance-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grayify: Image histogram equalization and contrast enhancement filter

License

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.


Table of Contents


About the Project

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

Features

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.

Getting Started

Clone the repository and set up your environment to run the app.


Prerequisites

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.


Installation

  1. Clone the repository (or download it as a ZIP):

    git clone https://github.com/your-repo-url.git
  2. Navigate to the project directory:

    cd image-to-grayscale-converter

Running Script

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.


Expectations When Running This App

  • 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.

Demo

Here's a quick overview of how the app works:

grayify-eq-enh-filter.mp4

Acknowledgments

  • Streamlit – For creating the web interface.
  • Pillow – For handling and manipulating images.
  • Matplotlib – For generating histograms.
  • Numpy – For array operations.

License

This project is licensed under the MIT License - see LICENSE file for details.

About

Grayify is a Streamlit application that converts an uploaded image to grayscale and generates a histogram of pixel intensities. It also offers two filter options; Equalize (histogram equalization) and Enhance (contrast enhancement).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages