Glyph Cropping by Manual Annotation and Font Creation

Glyph Cropping by Manual Annotation

Overview: The glyph isolation process was performed manually before developing the automated glyph cropping model. This method involved a series of steps to annotate and select glyph images for creating a usable font from Pecha publications.

Process:

  1. Glyph Selection:
  • List Creation: Identify and list the required Tibetan glyphs needed to generate the font.
  • Image Download: Download Pecha images from the specified publications that contain the required glyphs.
  1. Initial Glyph Detection:
  • OCR Application: Apply Google OCR (Optical Character Recognition) to the downloaded images to detect the Tibetan glyphs and obtain their bounding boxes.
  • Variants Collection: Collect approximately 100 variants of each glyph for cropping purposes.
  1. Glyph Extraction and Selection:
  • Cropping: Extract glyphs from the images using the bounding box coordinates obtained from OCR.
  • GitHub Upload: Upload the cropped glyph images to GitHub.
  • Selection: Select the 10 best images for each glyph from GitHub, based on visual quality and accuracy, with the help of annotators.
  1. Image Upload and Annotation:
  • Amazon S3 Upload: Upload the selected images to Amazon S3 for further processing.
  • Manual Annotation with Prodigy: Load the image data into Prodigy for manual annotation of glyph bounding boxes and baseline coordinates.
  • Annotation Data: Obtain the annotated data in JSON format.
  1. Data Finalization:
  • Cleaning: Use the annotation data to generate cleaned glyph images, ensuring that the images have no background artefacts and accurately represent the glyphs.

Outcome: This manual annotation process resulted in a curated set of high-quality glyph images, which were used as training data for developing and testing the automated glyph cropping model.

Font Creation from Tibetan Glyphs:

  1. Glyph Isolation: Using an automated glyph cropping model, individual Tibetan characters are extracted from high-resolution images of Pecha manuscripts. These glyphs are saved in PNG format.
  2. Conversion to Vector Format: The isolated PNG images of the glyphs are then converted into SVG (Scalable Vector Graphics) format. This conversion to a vector format ensures that the glyphs can be scaled to any size without loss of quality, making them ideal for use in font creation.
  3. Font Creation: The vectorized SVG glyphs are compiled into a font file, allowing for seamless resizing and consistent representation across different digital platforms.

For font creation, we require key metrics such as the baseline, Left Side Bearing (LSB), and Right Side Bearing (RSB). Annotators use Prodigy to label these metrics directly on glyph images.

From the annotations, we obtain the baseline, as well as the start and end points of the baseline. Using these, we calculate LSB and RSB as follows:

  • LSB is determined by the distance between the baseline start and the glyph’s left edge.
  • RSB is calculated as the distance between the glyph’s right edge and the baseline end.

The glyph’s right and left edges are identified programmatically to ensure precise measurements.