Read text from jpeg/jpg image


Does anyone know how to read text from or in an image. Please Help!!!


text on image?
I want to know also

I dont think you can read the text from an image, however there are other ways around:

  1. If its for a Captcha then you would store random text in a database and use the GD lib to write the text to the image, allowing users to input what they see to a form, and then check with that was stored in your database.

  2. Alt text - this is genreally supplied with an image as a attribute of the <img> tag. If you stored the text the image contained in it then you could access it.

Hope this helps,


This is done with OCR software. You could do it from PHP using command line OCR software but the image needs to be perfect, high contrast, a standard font and perfectly horizontal. If reading text from images was easy CAPTCHA scripts would become redundant overnight.

Hence the often squigglyness and allovertheplacedness of them…

I tend to use the same technique I use when reading normal text (though if it is a bit fuzzy I tend to squint)…