Skip to content

A Python command-line application to detect fonts of texts in images

License

Notifications You must be signed in to change notification settings

AYUSHSAGAR916/Pyfont

 
 

Repository files navigation

PyFont

made with &hearts in Python License MIT contributions welcome

Description

PyFont is a command-line application to detect fonts of text in images. It can be configured to include fonts existing in the system (eg. paid ones) as well.

Dependencies

Setup

Download the dependencies for your respective system.

git clone https://github.com/prnvdixit/Pyfont.git
cd Pyfont/
python3 main.py -i <image_path> <path_to_ttf_directory>

Working

Tesseract library is first used for OCR - Detecting text from the image supplied. The input image is cropped to text only (omitting out the unnecessary parts and borders). The text obtained from OCR is checked against different fonts (using the ttf-directory, supplied through commandline arguments) and is checked using image similarity algorithms for best matches.

Known Issues

  • Similarity doesn't seem like best possible way to compare fonts (Mostly as after pre-processing input image, some chars get distorted).
  • Currently, saving intermediate images is the only way I can come up with - It's a bottleneck in the functioning.

Future work

  • Add rotational invariance for input images
  • Use Google API (give a cmd arguement for same) instead of downloading the .ttf files
  • Add tests

Contributors

License

See the LICENSE.md file for license rights and limitations (MIT).

About

A Python command-line application to detect fonts of texts in images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.7%
  • HTML 5.3%