How to invert black and white with scikit-image?

Pamungkas Jayuda picture Pamungkas Jayuda · Jan 22, 2015 · Viewed 32.9k times · Source

I read an image with ndimage, which results in a binary image like this:

enter image description here

I would like to invert the image such that white turns into black, and vice versa.

Help is appreciated.

Answer

Pamungkas Jayuda picture Pamungkas Jayuda · Jan 22, 2015
numpy.invert(close_img)

I use invert array. It works for me.