Convert RBG Image to Gray Scale Image Using CV2

Hi Everyone, In this Post, We Will Learn How to Convert a Simple RBG Image to Gray Scale Image It's Very easy to convert any image into grayscale image using Python CV2 Library. So Now Let's Start How We Can do this, Follow the Post Until End.
We Use Two Method for Convert Image into Gray Scale Image.
First Method
import cv2
img = cv2.imread('logo.png')
cv2.imshow('output ', img)
cv2.waitKey(0)
grey_scale = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
cv2.imshow('Greyscale', grey_scale)
cv2.waitKey(0)
cv2.destroyAllWindows()
Output
Second Method
import cv2
img = cv2.imread('logo.png', 0)
cv2.imshow('Grey Scale Image ', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Output
Download Source Code
Thanks for Reading Share this
Random Blogs
- Extract RGB Color From a Image Using CV2
- Top 10 Blogs of Digital Marketing you Must Follow
- Understanding AI, ML, Data Science, and More: A Beginner's Guide to Choosing Your Career Path
- Government Datasets from 50 Countries for Machine Learning Training
- Google’s Core Update in May 2020: What You Need to Know
- OLTP vs. OLAP Databases: Advanced Insights and Query Optimization Techniques
- Top 10 Knowledge for Machine Learning & Data Science Students
- Deep Learning (DL): The Core of Modern AI
- Mastering SQL in 2025: A Complete Roadmap for Beginners
- Store Data Into CSV File Using Python Tkinter GUI Library
Prepare for Interview
Datasets for Machine Learning
- Bank Transaction Fraud Detection
- YouTube Trending Video Dataset (updated daily)
- Covid-19 Case Surveillance Public Use Dataset
- US Election 2020
- Forest Fires Data Set
- Mobile Robots Data Set
- Safety Helmet Detection
- All Space Missions from 1957
- OSIC Pulmonary Fibrosis Progression
- Wine Quality
- Google Audio Dataset
- Iris flower data set
- Artificial Characters Data Set
- Bitcoin Heist Ransomware Address Dataset Data Set