Transform old black-and-white photos into vibrant, realistic color images using Deep Learning + OpenCV, wrapped in a modern Tkinter GUI with advanced post-processing enhancements. This project leverages a pretrained CNN-based colorization model and applies multiple post-processing techniques to significantly improve visual quality.
- 🖼️ Black & White Image Colorization
- 🧠 Deep Learning-based Color Prediction (OpenCV DNN)
- 🎛️ Advanced Post-Processing Pipeline
- 🧴 Noise reduction & edge-preserving smoothing
- 🌈 Contrast enhancement using CLAHE
- 🎨 Controlled saturation boosting
- 🧑 Skin tone detection & correction
- 🔍 Advanced sharpening for fine details
- 📈 Super-resolution upscaling
- 🧵 Multi-threaded processing (UI never freezes)
- 💾 Save colorized images in high quality
- 🎨 Modern dark-themed GUI built with Tkinter
- Input image is converted from BGR → LAB color space
- L channel (grayscale) is fed to a pretrained CNN
- Model predicts A & B color channels
- LAB image is reconstructed and converted back to BGR
- Post-processing improves realism and perceptual quality
- Python
- OpenCV (DNN module)
- NumPy
- Tkinter
- Pillow (PIL)
Image-Colorization/
│
├── Models/
│ ├── colorization_deploy_v2.prototxt
│ ├── colorization_release_v2.caffemodel
│ └── pts_in_hull.npy
│
├── colorization_gui.py
├── requirements.txt
└── README.md
git clone "url"
cd image-colorization-tool
pip install -r requirements.txt
Place the following files inside the Models/ directory:
-
colorization_deploy_v2.prototxt
-
colorization_release_v2.caffemodel
-
pts_in_hull.npy
- ℹ️ See the References section below for official download links.
Run the application:
python colorization_gui.py
- 📁 Click Browse Image
- ✨ Click Colorize
- 🎉 Preview the colorized output
- 💾 Save the result
To improve realism, the following enhancements are applied after colorization:
- 🔇 Noise reduction (Non-local Means)
- 🌗 Contrast enhancement (CLAHE on L channel)
- 🌈 Saturation boost (HSV space)
- 🧠 Edge-preserving smoothing (Bilateral Filter)
- 🧑 Skin tone detection & correction
- 🔍 Advanced sharpening
- 📈 Super-resolution upscaling
This significantly reduces:
- Washed-out colors
- Color bleeding
- Flat contrast
- Unrealistic skin tones
| Original Black & White Image | Colorized Image |
|---|---|
![]() |
![]() |
The performance of the image colorization model was evaluated using standard image quality and perceptual similarity metrics. The following are the average results obtained across the evaluation dataset:
| Metric | Value | Description |
|---|---|---|
| PSNR (Peak Signal-to-Noise Ratio) | 19.86 dB | Measures reconstruction quality; higher values indicate better fidelity |
| SSIM (Structural Similarity Index) | 0.9086 | Evaluates perceptual and structural similarity (closer to 1 is better) |
| MSE (Mean Squared Error) | 933.44 | Measures average pixel-wise error; lower is better |
| Color Correlation | 0.9610 | Indicates how closely the predicted colors match the ground truth |
The following visualization provides a graphical overview of the evaluation metrics, helping to better understand the model’s performance across different quality measures:
- High SSIM and Color Correlation values indicate strong preservation of image structure and realistic color distribution.
- The PSNR value aligns with typical learning-based colorization models, which favor perceptual realism over pixel-level accuracy.
- Overall, the metrics confirm that the model produces visually coherent and perceptually convincing colorized images.
- Colors are predicted, not restored — results may vary
- Rare objects may receive inaccurate colors
- Works best with clear grayscale or B&W images
-
Zhang, R., Isola, P., & Efros, A. A.
Colorful Image Colorization
https://arxiv.org/abs/1603.08511 -
Official Pretrained Model Repository
GitHub - richzhang/colorization -
OpenCV Deep Neural Network (DNN) Module
OpenCV DNN Docs -
OpenCV Image Processing Documentation
OpenCV Docs -
Non-Local Means Denoising (OpenCV)
Tutorial: Non-Local Means Denoising -
CLAHE – Contrast Limited Adaptive Histogram Equalization
Tutorial: CLAHE -
Model Files for Colorization (Caffe-based)
colorization_deploy_v2.prototxt(network architecture)
Download Linkcolorization_release_v2.caffemodel(pre-trained weights)
Download Linkpts_in_hull.npy(cluster centers for ab channels)
Download Link
👨💻 Developed By - @Arijit2175


