But you need to keep in mind, what is the quality of your original image. You mentioned "JPG" in the beginning. Usually lines in JPG are very much "corrupted" by the JPG algorithm (JPG is not meant for lines, but for photos, and photos of real life do not have plain black-lines-on-white). In JPG algoritm your lines are most likely "anti-aliased" which makes them look like the 2nd line from the picture:
The "imperfection" into the line introduced by JPG (or any other lossy-image-compression algorithm like PNG) is called "artifact". So you can see examples of artifacts in images here:
Here's an example of artifacts introduced into BW text by JPG algorithm:
You need to be aware of the artifacts and make sure that the quality of your image is good enough. (Maybe even switch from JPG to other format. Otherwise readings with
- color colorOfLetterAasInAsterix = get(x,y);