CoolFace
Apppublic

Daksahaini/color-space-explorer

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes
App README

๐ŸŽจ Color Space Explorer

An interactive educational app for the Intro to Image Analysis course at the University of Bern (2026).

Project Summary

This app teaches four image analysis concepts through interactive visualisation: colour space decomposition (RGB, HSV, LAB, YCbCr, Grayscale), gamma correction, white balance adjustment, and colour blindness simulation. The user can upload any image or use a built-in sample, then explore how each concept transforms the image in real time.

Hugging Face Space

๐Ÿ‘‰ [https://huggingface.co/spaces/Daksahaini/color-space-explorer](https://huggingface.co/spaces/Daksahaini/color-space-explorer)

What it does

TabConcept
Colour SpacesChannel decomposition, histograms, pixel scatter, HSV editor
Gamma CorrectionNon-linear brightness mapping with live curve
White BalanceTemperature and tint correction
Color BlindnessSimulation of Protanopia, Deuteranopia, Tritanopia, Monochromacy

Features

  • โ€”Upload your own image or use a built-in sample (3 included)
  • โ€”Switch between 5 colour spaces instantly
  • โ€”Side-by-side input / output comparison in every tab
  • โ€”Per-channel visualisation, histograms, and pixel colour-cloud scatter plot
  • โ€”Interactive HSV editor (hue shift, saturation, brightness)
  • โ€”Gamma correction with live gamma curve plot
  • โ€”White balance with per-channel delta metrics
  • โ€”Color blindness simulation with difference heatmap
  • โ€”Quantitative metrics: colourfulness, brightness, saturation, contrast

Local Setup

bash
git clone https://huggingface.co/spaces/Daksahaini/color-space-explorer
cd color-space-explorer
pip install -r requirements.txt
streamlit run app.py

File Structure

โ”œโ”€โ”€ app.py                  # Main Streamlit application
โ”œโ”€โ”€ processing.py           # Image transformation functions
โ”œโ”€โ”€ metrics.py              # Quantitative metric calculations
โ”œโ”€โ”€ utils.py                # Sample image generation & helpers
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ sample_images/          # Auto-generated on first run
โ””โ”€โ”€ docs/
    โ””โ”€โ”€ design_choices.md   # Design decisions and rationale

Screenshots

<img src="screenshots/screenshot_colorspaces.png" width="700"/>

<img src="screenshots/screenshot_gamma.png" width="700"/>

<img src="screenshots/screenshot_colorblindness.png" width="700"/>

Known Limitations

  • โ€”White balance uses a simple linear adjustment. Real photo editors are more precise.
  • โ€”Color blindness simulation is an approximation โ€” it does not perfectly match every person's vision.
  • โ€”Gamma correction changes the whole image equally. It cannot treat dark and bright areas separately.
  • โ€”Large images are resized to 800 px automatically. Some fine detail may be lost.
  • โ€”The app runs on a free server, so processing may be slow for very large images.