ImageColorizer is a tool for automatically colorizing black and white images using deep learning. This project uses a pre-trained model to add natural colors to grayscale photos, making them look more vivid and realistic.
- Automatic colorization of black and white images
- Utilizes state-of-the-art deep learning models
- Easy-to-use command line interface
- Supports common image formats (JPEG, PNG, etc.)
-
Clone the repository
git clone https://github.com/ayanbag/ImageColorizer.git cd ImageColorizer -
Create and activate a virtual environment (recommended)
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies
pip install -r requirements.txt
To colorize a black-and-white image:
python colorize.py --input path/to/your/image.jpg --output path/to/save/colorized.jpgParameters:
--input: Path to the input grayscale image.--output: Path where the colorized image will be saved.
Example:
python colorize.py --input images/grayscale_photo.jpg --output results/colorized_photo.jpgYou can try the tool using the sample images provided in the images directory:
python colorize.py --input images/example_bw.jpg --output results/example_color.jpg- Python 3.6+
- See
requirements.txtfor the full list of dependencies.
ImageColorizer/
├── colorize.py
├── requirements.txt
├── README.md
├── images/
└── results/
Contributions are welcome! Please open issues or submit pull requests for improvements or bug fixes.
This project is licensed under the MIT License. See LICENSE for details.
- Pre-trained model and research inspiration from Zhang et al., 2016
- Thanks to the open-source community for supporting this project.