# Arabic Ocr

> Arabic OCR text extraction from images and documents

- **Type:** Skill
- **Install:** `agentstack add skill-moshe-ship-hurmoz-arabic-ocr`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Moshe-ship](https://agentstack.voostack.com/s/moshe-ship)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Moshe-ship](https://github.com/Moshe-ship)
- **Source:** https://github.com/Moshe-ship/hurmoz/tree/main/arabic-ocr

## Install

```sh
agentstack add skill-moshe-ship-hurmoz-arabic-ocr
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# التعرف على النص العربي (OCR)

## Tesseract (محلي — الخيار الأساسي والمجاني)

### تثبيت
```bash
# macOS
brew install tesseract tesseract-lang imagemagick

# التأكد من دعم العربي
tesseract --list-langs | grep ara
```

### استخراج النص
```bash
tesseract IMAGE_FILE output -l ara
cat output.txt
```

### عربي + إنجليزي معاً
```bash
tesseract IMAGE_FILE output -l ara+eng
```

### تحسين الدقة
```bash
# تحسين الصورة أولاً
magick IMAGE_FILE -resize 300% -sharpen 0x1 -threshold 50% improved.png
tesseract improved.png output -l ara --psm 6
```

## TrOCR عبر HuggingFace (بديل سحابي — اختياري)

> **تنبيه**: توفر نماذج HuggingFace Inference API يتغير. تحقق من توفر النموذج قبل الاعتماد عليه في بيئة إنتاجية. إذا كان النموذج غير متاح، استخدم Tesseract المحلي.

```bash
# microsoft/trocr-large-printed — نموذج OCR عام قوي
curl -s -X POST "https://api-inference.huggingface.co/models/microsoft/trocr-large-printed" \
  -H "Authorization: Bearer $HF_TOKEN" \
  -H "Content-Type: image/png" \
  --data-binary @IMAGE_FILE

# للنصوص العربية تحديداً، جرّب:
# yazeed7/arabic-trocr أو أي نموذج عربي متاح على HuggingFace
curl -s -X POST "https://api-inference.huggingface.co/models/yazeed7/arabic-trocr" \
  -H "Authorization: Bearer $HF_TOKEN" \
  -H "Content-Type: image/png" \
  --data-binary @IMAGE_FILE
```

## أوضاع PSM (Page Segmentation Modes)
| الوضع | الاستخدام |
|-------|-----------|
| `--psm 3` | تلقائي (افتراضي) |
| `--psm 6` | كتلة نص واحدة (الأفضل للمستندات) |
| `--psm 7` | سطر واحد |
| `--psm 8` | كلمة واحدة |
| `--psm 13` | نص خام بدون OSD |

## متى تستخدم
- المستخدم يرسل صورة فيها نص عربي
- يريد استخراج نص من مستند PDF ممسوح
- يريد قراءة مخطوطة أو وثيقة قديمة
- يريد تحويل صورة واتساب فيها نص لنص قابل للنسخ

## القواعد
- ابدأ دائماً بـ Tesseract المحلي — يعمل بدون إنترنت وبدون مفاتيح API
- الصور الواضحة عالية الدقة تعطي نتائج أفضل
- المخطوطات والخطوط المزخرفة تكون أقل دقة — نبّه المستخدم
- إذا النتيجة ضعيفة، اقترح تحسين الصورة أولاً بـ magick
- نماذج HuggingFace اختيارية وقد لا تكون متاحة دائماً

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Moshe-ship](https://github.com/Moshe-ship)
- **Source:** [Moshe-ship/hurmoz](https://github.com/Moshe-ship/hurmoz)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-moshe-ship-hurmoz-arabic-ocr
- Seller: https://agentstack.voostack.com/s/moshe-ship
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
