Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I remove all but one color in an image?

In GIMP I am able to do the following:

Tools -> Selection Tools -> By Color Select (Shift+O)

Click on the single color I want to keep

Select -> Invert (Shift+I)

Edit -> Clear (Delete)

This allows me to remove all but the one color I clicked on. How can I do this in Python with opencv?

click to hide/show revision 2
No.2 Revision

How do I remove all but one color in an image?image (Python)?

In GIMP I am able to do the following:

Tools -> Selection Tools -> By Color Select (Shift+O)

Click on the single color I want to keep

Select -> Invert (Shift+I)

Edit -> Clear (Delete)

This allows me to remove all but the one color I clicked on. How can I do this in Python with opencv?