I am working in a project which involves recognition of characters in an image. I need to switch the dark parts of the image to light, and the light parts to dark (or black), because the program uses light as background and dark as leters.
Can anybody please tell me any Script which helps me doing that? Either in JavaScript or in Python.
Thank you.
I am working in a project which involves recognition of characters in an image.
Share
You will need some library to read the image like opencv.
Since usually white is 255, use this to invert the colors: