Converting an RGB image into a pure black and white image in python

Hello programmers this is Satyam,again back with another awesome blog and in this blog I am going to convert an RGB image into a pure black and white image using Python programming language and for this I will use a library called pillow,now this library doesn't comes with the standard python library,so you to install it using pip.
 
pip install pillow

Now after successful installation you will need an image (an RGB image) and after selecting the image.Let's open any python editor and write the code as below given.



In this case I have taken an image named skv.png and after running the program you will get a black and white image in the same folder where your python file is located and it will be converted to a black and white image,you can use many other properties and for that you can use Google 😎.

Image used:


Output Image:






Thanks for Reading
Share:

Post a Comment

Copyright © DevTipsNTricks. Designed by OddThemes