Recognising text characters from an image

Hi,

So let’s say you have an image of a letter, for example, let’s use the popular Words with Friends letters:

What would be the best way to detect each letter from this image?

At first I collected images of all the black letters and saved them into a database, then use that to compare the 2 images, if they are sufficiently similar, it would then be assigned the corresponding letter.

But my way has many limitations, such as if a letter with a different coloured font is used, then the comparison would not work.

What better options are there for detecting the letters?