Inspiration

I built Underwater Image Enhancement for my Digital Image Processing course. Underwater photos often have a blue-green tint and low contrast, which can make details difficult to see. I wanted to build a web app where users could upload their own photos, adjust the enhancement settings, and see what each processing step changes.

What it does

Users can upload an underwater photo, adjust the enhancement settings, and drag a slider to compare the original with the processed image. They can inspect intermediate results, compare the original and final RGB histograms, and download the enhanced image as a full-resolution PNG.

How I built it

I built the interface with React and Tailwind CSS and connected it to a Flask API. The backend uses Python, OpenCV, and NumPy to process each image in four steps:

  1. Gray-world white balance scales the red, green, and blue channels to reduce the overall color cast.
  2. CLAHE improves local contrast on the lightness channel in the LAB color space.
  3. Gamma correction adjusts the brightness of midtones.
  4. Sharpening emphasizes edges and fine details.

I packaged the React frontend and Flask backend in a single Docker image so the same service can serve the interface and process images.

Challenges I faced

One challenge was making the effect of each step visible. A single final image made it hard to tell which operation changed the colors, contrast, or brightness. I added stage-by-stage previews and used the same scale for both RGB histograms so users could compare the results directly.

I also ran into deployment issues when the Dockerfile expected files in different locations from my GitHub repository. After fixing the build paths, I addressed a Python import error that prevented Flask from starting inside the container.

What I learned

I learned how to turn an image-processing script into an interactive web application, from handling uploads in Flask to presenting results in React. I also learned to judge image quality visually alongside the histograms. A histogram can show how pixel intensities shifted, while a side-by-side comparison helps me see whether the colors look natural and the details are easier to distinguish.

Built With

Share this project:

Updates