Cenchrus 0 Newbie Poster

Hey guys, I'm looking for a python library that can.

1. Act as a simple paint editor.
2. calculate top, bottom, left, right most points of a picture

I'm trying to make a simple handwriting recognition software based on the number of permutations possible
for simple endpoints.

Example: psudocode for one paramater.

If Distance From top to bottom / Distance from Left to Right == Statistically significant:
    paramater  = paramater + 1
else:
    Increase approximation number
    if approximation number >= 100
        Exit