Recognizing a font from an image using PHP

I'm curious - how to recognize the font from the provided image ...

EDIT: ... using PHP? For example, a user uploads a photo of some text (say, from a newspaper) and wants to know which font was used or which font is the most similar.

+4
source share
5 answers

try this online tool: What is a font

+4
source

If you do not have a scan, try http://www.identifont.com/ . (But that won't help you do this in php, admittedly.)

+1
source

I think what he asks is a public library for pattern recognition. Basically, this is a kind of OCR that can identify text and match text in the image with vectors of the font family. Am I right?

Unfortunately, I have to say (to my knowledge) that there is no such library. There is for regular OCR, though.

http://www.aquaforest.com/en/ocrsdk.asp

One of the problems with determining the font family of an image is that many font families have similar vectors. This means that a font like Georgia can easily be mistaken for Times New Roman, etc.

+1
source

This is obviously an old question, but I'm really proud of our font matching mechanism, so please let me add some relative information.

This is not a public library or SDK (at least for now) but it is an engine built into the product:

http://www.findmyfont.com

It reads the image (or captures the screen) and matches the characters you have selected with all the fonts on your computer β€” either installed or not.

The corresponding speed is up to 5 million fonts per minute, which means that it can correspond, for example. 5-6 letter image versus 100,000 fonts in 1-2 seconds.

The accuracy of the match mainly depends on the image quality and resolution (a minimum height of 20 pixels is recommended), and also depends on how unique the shape of the selected letters is. In general: if you really have a font on your computer and select 2-3 letters of any image, you will find the actual font in the top 5 matches - usually the top match - and this is true for as many as 600,000 font files.

Now we are in beta testing the new version, which allows the application to match also fonts that you do not have on your computer by sending a compliance request to the online server.

I can’t talk much about our own matching algorithm, but I can say the following:

a. You do not need to interfere with the actual shape of the vector font: a good enough bitmap image of the letter is enough to successfully extract the function.

b. If you want to achieve high performance matching, you need to create and save the appropriate index by scanning once all the letters of all fonts.

I hope it’s clear that I don’t post all this information to advertise the product, but to say that I am really proud as a developer to develop and implement this font matching mechanism.

Greetings

Fivos

PS: environment / implementation language: Qt / C ++ for Windows / Mac OS / CentOS.

0
source

All Articles