A Novel Deep Learning Approach for High-Fidelity Vectorization of Arabic Calligraphy

Siraj R. Allaf *

Department of Electrical and Computer Engineering, King Abdulaziz University, Jeddah, Saudi Arabia.

*Author to whom correspondence should be addressed.


Abstract

Arabic calligraphy, a centuries-old art with deep cultural and spiritual meaning, requires accurate digital representation to preserve its historical and artistic importance. Arabic calligraphy relies on precise stroke continuity, curvature harmony, and proportional balance. However, when calligraphic works are digitized, standard auto-vectorization tools often fail to preserve these qualities, producing vectors with either too many or too few anchor points. This leads to curves that appear fragmented or oversimplified, requiring extensive manual correction. Unlike traditional raster-to-vector tools that rely on fixed heuristics, the proposed method predicts optimal tracing parameters directly from the input image, enabling significantly smoother curvature and more coherent stroke continuity.

This study proposes a deep learning–based approach that treats calligraphic vectorization as a parameter prediction task rather than direct curve generation. For each input image, multiple vectorizations are first generated using Potrace under varied parameter settings, and the best configuration is selected relative to a high-quality Vector Magic (VM) raster rendering used only as a scoring reference, using a composite evaluation that combines image similarity metrics (IoU, Dice, SSIM, Chamfer) with structural efficiency (path and segment counts). A neural model is then trained to predict these optimal parameters directly from the raster image, enabling high-quality vector output at inference time.

The method was evaluated on 2,418 samples from Naskh, Reqaa, and Dewani styles. It achieved IoU = 0.9953, Dice = 0.9976, SSIM = 0.9787, and a mean Chamfer distance of 0.159 px, while reducing the average vector structure to 1.38 paths and 28.84 segments. The resulting vectors exhibit smoother curvature and more coherent stroke flow compared to standard auto-tracing. These results demonstrate the approach as a promising proof of concept, indicating that learning-based parameter prediction can approximate manual refinement and may achieve even greater accuracy with larger and more stylistically diverse datasets, as well as with more advanced vector refinement methods.

Keywords: Arabic calligraphy, deep learning, vectorization, computer vision, art


How to Cite

Allaf, Siraj R. 2025. “A Novel Deep Learning Approach for High-Fidelity Vectorization of Arabic Calligraphy”. Journal of Advances in Mathematics and Computer Science 40 (12):1-14. https://doi.org/10.9734/jamcs/2025/v40i122069.

Downloads

Download data is not yet available.