Find the Complementary of image which is 8 bits gray scale image.
Each pixel is converted to binary format in the image.
After that take complementary of each pixel.
In the end output is converted to uint8.
input(my photo) Gray Scale image
output is like