DEV Community

El Bruno for Microsoft Azure

Posted on • Originally published at elbruno.com on

#OpenCV – How to convert to grayscale and show a single color an image πŸ–ΌοΈ using Python 🐍

Hi !

Super quick post today with a cool scenario to support my TikTok videos in Spanish (I know πŸ˜€):

How to convert to grayscale an image and show a single color using python and opencv

Here is the output with an original photo from my office and a new image with this effect:

opencv convert to grayscale and show a single color

_ Disclaimer: I got this example in my notes from long time ago. I thik I got this code from a blog post or a public repository, however, I can’t find the original source. If you know it, please let me know so I can mention the author._

Sample code:

Happy coding!

Greetings

El Bruno


OpenCV and Python

Top comments (0)