Compare Text Sample With Your Fonts
Rank the font files you supply by how closely they match a picture of text.
How it works
Upload a picture of one or more lines of text, type the text it shows and add up to four font files you own. The tool finds each character, draws the same characters with every font from its own outlines at a matching size and ranks the fonts by shape, overlap, width, height, stroke weight and baseline. It compares your sample with the fonts you provide — it does not identify unknown fonts. Files are uploaded to the server for this calculation; Lumina's Type Lab Font Matcher does the same on your device.
- The sample is converted to luminance (transparent pixels on white). Ink is separated with Otsu's threshold, or your fixed threshold; with automatic text colour the smaller class is ink. Images above 2000 pixels per side or 2.4 megapixels are scaled down first.
- Tilt is estimated between −10° and +10° by maximising the energy of the horizontal projection profile (0.5° steps, refined to 0.1°) and removed by bilinear rotation. Specks smaller than 3 pixels (or 2% of the median part) are dropped.
- Characters are 8-connected ink parts. Rows with ink form lines (thin rows such as accents join their nearest line); parts of one line that overlap horizontally by at least half the narrower width are merged (i-dots, umlauts, colons). Boxes are read top to bottom, left to right and paired with the characters of your text without spaces; the counts must match. Touching or broken letters need the box editor in Lumina's Type Lab.
- Every font draws each character from its own TrueType outlines (default instance; composite glyphs resolved) with a non-zero rasteriser. One size per font is chosen as the median ratio of sample height to drawn height over the taller characters, so proportions between letters stay meaningful.
- Per character: shape = exp(−d/1.5) with d the symmetric mean 3-4 chamfer distance on 32 × 32 grids of each glyph's own box; overlap = best Dice over ±1 cell; aspect, height and stroke width (2 × area / perimeter) as exp(−3·|ln ratio|); baseline = exp(−5 × offset / line height) against the line's median baseline; moments = exp(−mean |Δ log10|) of the first two Hu invariants. Score = 30% shape + 15% overlap + 13% aspect + 12% height + 15% stroke + 8% baseline + 7% moments.
- A font's score is the mean over all characters; characters the font does not contain count as 0 and are listed. Scores are similarities between 0 and 100, not probabilities. CFF (PostScript-outline) OpenType fonts, WOFF2 and font collections are excluded with a reason. Kerning, ligatures and right-to-left reading order are not modelled; type the characters in left-to-right visual order.
Sources
- Otsu: A threshold selection method from gray-level histograms (IEEE SMC 1979) (IEEE)
- Hu: Visual pattern recognition by moment invariants (IRE Trans. Information Theory 1962) (IEEE)
- Borgefors: Distance transformations in digital images (CVGIP 1986) (Elsevier)
- OpenType glyf table (TrueType outlines) (Microsoft)
Part of Lumina
-
Lumina Photo editor & image toolkit
Bring out what you saw. A free photo studio.
Related tools
- Font File Inspector & Glyph Coverage – Read TTF, OTF and WOFF names, tables, metrics, axes, kerning and Unicode coverage.
- Letterform Mask Comparison – Compare two binary text masks by letterform overlap and aspect ratio.
How to compare a picture of text with your own fonts
Rank the font files you own by how closely their letters match a photo or screenshot of text, with per-letter scores and overlays.
What it is for
You have a picture of lettering — a poster, a screenshot, an old logo — and a handful of candidate fonts on your computer. Which of them is closest? This tool finds every character in the picture, draws the same characters with each font you upload at a matching size and ranks the fonts by how well the shapes agree.
It compares your sample with the fonts you provide — it does not identify unknown fonts. There is no font catalogue, OCR or online search behind it: if the right font is not among your files, the ranking only tells you which of your files comes closest. Lumina's Type Lab has the same comparison as the Font Matcher, where the picture and fonts stay on your device and you can fix character boxes by hand.
Worked example
The first example uses a picture of "HOT VOLT" written in the Bold style of Lumina's own starter font, with some grain added, and uploads the Light and Bold styles as candidates. The tool finds 7 characters on 1 line, picks an ink threshold of 138 and needs no straightening. Lumina Starter Bold scores 95.3 and Lumina Starter Light 61.04, both with all characters present. The stroke ratio says why: Light's strokes are 0.4734 times as thick as the sample's, Bold's 1.0559 times.
The second example tilts a "TOIL HOT" sample in the Light style by 3° and adds grain. The tool removes a tilt of 2.9° before comparing, and now Light leads with 92.37 against 62.25 for Bold.
How to read the result
- Font ranking lists every compared font with its score from 0 to 100, the share of characters it contains, and the stroke and width ratios (font ÷ sample; 1 means equal).
- Per character breaks the leading font's score down: shape (outline distance), overlap, aspect (width to height), height relative to the other letters, stroke weight and baseline position. A low value points to the letter that differs.
- The overlay puts each sample letter on top of the font's letter: dark grey is shared ink, orange is only in your picture, teal only in the font.
- Fonts not compared gives the reason, for example CFF outlines or an unreadable file.
Scores are similarities, not probabilities. Missing characters count as 0, so a font that lacks letters drops in the ranking.
Tips and common mistakes
- Type the text exactly as shown, including case and punctuation. Spaces are ignored, but the number of characters must equal the number of letter shapes found.
- Letters that touch or break apart change that count. Crop to clean lettering, try a fixed threshold, or use the Font Matcher in Lumina, where you can merge, split and draw boxes.
- Use fonts with TrueType outlines (most TTF files, many OTF and WOFF files). OpenType fonts with PostScript (CFF) outlines, WOFF2 and collections are not supported.
- Light text on a dark background is detected automatically; set the text colour yourself if the picture is mostly ink.
- Compare weights of one family as separate files: stroke weight is one of the strongest signals.
- Only upload fonts you are allowed to use. The tool does not store them.
FAQ
Can it tell me the name of an unknown font?
No. It ranks only the files you upload. For an unknown font, collect likely candidates first and then compare them here.
Why does the correct font not score 100?
Photos and screenshots blur, threshold and pixelate letters, and each font is drawn at one common size. Scores in the 90s are typical for the font that drew the sample.
What happens to my files?
The tool uploads the picture and up to four fonts to the server for the calculation and does not keep them. The Font Matcher in Lumina does the same work in your browser.
Does it handle kerning, ligatures or Arabic script?
No. Each character is compared on its own; kerning, ligatures and joined script forms are not modelled, and boxes are read left to right.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://luminafontcompare.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://luminafontcompare.usefulweb.app/mcp· tool namelumina_font_compare
Example request
curl -s -X POST https://luminafontcompare.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'