Read text from image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
scts102
Forum Newbie
Posts: 23
Joined: Thu Aug 25, 2005 2:15 pm

Read text from image

Post by scts102 »

Hello,

Is is possible to read the text from a png file in php? The length of the text would always be 32 characters, with never any spaces. The string starts after a * and ends at the next *
eg: *ddb95d7abcdfb7f79f96ba59aa89waa6*

Now, each image would have a different set of characters, but they would all be in the same spot on the image.
I know it is possible to do this in Windows programming languages such as c++ and delphi, but I do not have much experience with php. I did search google briefly, and found nothing.

So...it is possible? And if so, how would I go about doing it?
Thanks.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Short of some sort of character recognition software (which you would probably exec()), if you wanted to do it in PHP then maybe you could cut each character out of the image (GD/Imagemagik) and do a binary comparison with a set of reference images. You could probably simplify it a little by just comparing MD5s of the two. But all that assumes that the characters in the image are always identical when cut-out. If there is anti-aliasing or different compression, then they would be different and comparing them would not work.
(#10850)
Post Reply