It sound like you're asking about character recognition in a JPG image. If not, please explain your question better. If so, you should learn how to open an image and understand that a pixel's color is already a number (3 numbers actually; the amount of red, blue and green) before you try to tackle this...