Black and White to Colour Images using Python With Source Code

Introduction
Hello Curious Coders,
In this project we are going to convert the Blacka and White Image to Colour Image using Python. To do so in python we have a popular package named as CV2 which is most used to perform image related operations.
Get Discount on Top Educational Courses
Source Code
# import required package
import cv2
# Load the B&W image
img = cv2.imread('bw_image.jpg', 0)
# Apply a pseudocolor effect to the B&W image
colorized = cv2.applyColorMap(img, cv2.COLORMAP_JET)
# Save the colorized image
cv2.imwrite('colorized_image.jpg', colorized)
Code Explanation
- First we imported the required package cv2.
- Next, we loaded the Black and White Image using cv2.imread() function.
- Later we colorized image using applyColorMap() function to colorize image using the COLORMAP_JET color map.
- Finally using imwrite() function of cv2 package we stored our colorized image.
Output
Input Image:

Output Image

Find More Projects
MathGenius Pro – AI-Powered Math Solver Using Python Introduction: From simple arithmetic to more complicated college-level subjects like integration, differentiation, algebra, matrices, …
CipherMaze: The Ultimate Code Cracking Quest Game Using Python Introduction: You can make CipherMaze, a fun and brain-boosting puzzle game, with Python …
Warp Perspective Using Open CV Python Introduction: In this article, we are going to see how to Create a Warp Perspective System …
Custom AI Story Generator With Emotion Control Using Python Introduction: With the help of this AI-powered story generator, users can compose stories …
AI Powered PDF Summarizer Using Python Introduction: AI-Powered PDF Summarizer is a tool that extracts and summarizes research papers from ArXiv PDFs using Ollama (Gemma 3 LLM). The …
AI Based Career Path Recommender Using Python Introduction: One of the most significant and frequently perplexing decisions in a person’s life is …