Khattat: Enhancing Readability and Concept Representation of Semantic Typography

Ahmed Hussein, Alaa Elsetohy, Sama Hadhoud, Tameem Bakr, Yasser Rohaim, Badr AlKhamissi

TL;DR

Khattat is an end-to-end automated system for "semantic typography"—the art of morphing letters into shapes that represent a word's meaning. By combining Large Language Models (LLMs) for creative brainstorming and a novel OCR-based loss function, Khattat generates highly creative, multi-letter illustrations in both English and Arabic while ensuring the text remains actually readable.

What Problem Does This Paper Address?

Semantic typography is a delicate balancing act. If you morph the letter "S" into a snake too aggressively, it becomes a cool drawing of a snake but a terrible letter "S." Traditionally, this process required a human designer to:

  1. Brainstorm: Figure out how to represent abstract concepts (like "freedom") visually.
  2. Select: Pick a font and specific letters that "fit" the intended shape.
  3. Execute: Manually warp the letters while trying to keep them legible.

Existing AI methods often struggle with cursive scripts like Arabic, are limited to morphing a single letter at a time, or produce "raster" images that can't be easily scaled or edited. Khattat aims to automate this entire pipeline while solving the "legibility vs. creativity" trade-off.

Methods

The Khattat pipeline consists of four main stages:

  1. The Prompt Engine (LLM): To handle abstract words (e.g., "Knowledge"), the system uses an LLM to suggest concrete, drawable objects (e.g., "an owl" or "a lightbulb"). It also suggests font attributes (e.g., "playful," "modern") to guide the style.
  2. Font & Region Selection: The system uses FontCLIP to automatically select the best font from a database. It then runs a "light" optimization to identify which subset of letters in a word has the best geometric potential to be morphed into the target shape.
  3. Morphing via Diffusion: Using Score Distillation Sampling (SDS) and a pre-trained Stable Diffusion model, the system iteratively deforms the vector outlines (Bézier curves) of the letters to match the target concept.
  4. The Secret Sauce (Loss Functions):
    • OCR-based Loss: This is the paper's key innovation. Instead of using a general image classifier to check "content," they use the feature space of an OCR encoder (SuryaOCR). This forces the model to preserve the specific features that make a letter recognizable to a reading system.
  5. ACAP Loss: To prevent the vector lines from tangling into a "noisy" mess, they use an "As-Conformal-As-Possible" loss to maintain the structural integrity of the letters.

Datasets

The authors evaluated Khattat using:

  • Font Database: A collection of various fonts used for the FontCLIP selection process.
  • Evaluation Set: 20 words (10 English, 10 Arabic) across eight categories (Sports, Animals, Abstract Concepts, etc.) generated by ChatGPT to ensure a fair, unbiased comparison.
  • Baselines: They compared their results against CLIPDraw and Word-as-Image.

Key Insights and Ideas

  • OCR as a Perceptual Metric: Standard perceptual losses (like VGG) are trained to recognize objects (dogs, cars). By using an OCR-trained encoder, the authors created a "readability guardrail" that understands the nuances of typography better than general computer vision models.
  • Multi-Letter Synergy: Unlike previous methods that morph one letter in isolation, Khattat can morph a continuous string of letters. This is essential for cursive scripts like Arabic, where letters are naturally connected.
  • Abstract to Concrete: The use of an LLM as a "creative director" allows the system to bridge the gap between a word like "Freedom" and a visual like "Wings," which a pure image-generation model might not link as effectively on its own.

Key Results

  • Legibility: In quantitative tests, Khattat achieved significantly higher OCR accuracy (0.64 for Arabic, 0.78 for English) compared to the Word-as-Image baseline (0.35 and 0.62, respectively).
  • Human Preference: A study with 74 participants showed that Khattat was the clear winner in readability across both languages.
  • Visual Appeal: While CLIPDraw often produced more "artistic" (but unreadable) results, Khattat was ranked as more visually appealing than Word-as-Image in English and nearly tied in Arabic.
  • Multilingual Versatility: The paper demonstrates successful results in English, Arabic, Korean, Chinese, Hindi, and Greek.

Limitations and Future Work

  • Non-Consecutive Letters: Currently, the system only morphs continuous substrings (e.g., the first three letters). It cannot yet morph the first and last letter while leaving the middle untouched.
  • Partial Morphing: The system deforms the entire outline of the selected letters; it doesn't yet support morphing just a specific stroke of a letter.
  • Color and Texture: While the paper shows some colored examples, these were post-processed using a separate depth-to-image diffusion step. Integrating color directly into the vector optimization is a suggested next step.
  • Aesthetic Metrics: The authors note that "CLIPScore" isn't a perfect measure of beauty and suggest developing better metrics to quantify the "artistic quality" of typography.

Summary updated

BibTeX
@inproceedings{hussein2024khattat,
  author = {Ahmed Hussein and Alaa Elsetohy and Sama Hadhoud and Tameem Bakr and Yasser Rohaim and Badr AlKhamissi},
  title = {{Khattat: Enhancing Readability and Concept Representation of Semantic Typography}},
  booktitle = {Workshops @ ECCV},
  year = {2024},
  url = {https://openreview.net/forum?id=SIoC8Kq0Yl},
}

Loading related content...

Figure