Invert

Context:

After thresholding or grayscaling, you may find particular use in inverting the image. White values are black and black values are white. Gray pixel values are also inverted.

Arguments:

  • Requires a path to your image.

  • Grayscaled image. Using a RGB image will be spooky!

Code:

Results:

_images/pig.png

Original Raw Image

_images/gray.png

This is what our pig looks like in grayscale

notice the inversion of the background and the pigs eye

_images/invert.png

This is what our pig looks like inverted!