pdf-scan-layer-cleaner
Skill1 starsChanged 3 months agoMITView on GitHub
مهارات تنظيف مستندات كتب الـ PDF الممسوحة ضوئياً من الطبقات المضللة، الخفيات الرمادية، الصور المزدوجة، ومسارات القص مع الحفاظ على النص الناصع وإمكانية البحث والنسخ دون ظهور مستطيلات سوداء.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- 1stANUNNAKI/majlisword for word, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 1
- 1stANUNNAKI/majlis★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository92 other files it gives its agents.
- npm/AGENTS.mdAGENTS.md
- advanced-image-slicing-skillSkill
- agents-sdkSkill
- agent-weaver-builderSkill
- alphafold-database-fetch-and-analyzeSkill
- alphagenome-single-variant-analysisSkill
- animation-scroll-effectsSkill
- backend-api-shield-servicesSkill
- chembl-databaseSkill
- chronicle-logger-timestampSkill
- cicd-automation-deploySkill
- cinematic-animator-gsapSkill
- clinical-trials-databaseSkill
- clinvar-databaseSkill
- cloudflare-ai-resourcesSkill
- cloudflare-email-serviceSkill
- cloudflare-one-migrationsSkill
- cloudflare-oneSkill
- cloudflareSkill
- data-modeler-schemaSkill
- dbsnp-databaseSkill
- design-system-master-hslSkill
- durable-objectsSkill
- embl-ebi-olsSkill
- encode-ccres-databaseSkill
- ensembl-databaseSkill
- explode-animation-skillSkill
- find-skillsSkill
- foldseek-structural-searchSkill
- frontend-clean-coder-jsSkill
- gnomad-databaseSkill
- google-antigravity-sdkSkill
- gtex-databaseSkill
- human-protein-atlas-databaseSkill
- inner-learner-feedbackSkill
- integrative-architect-docsSkill
- intent-observer-audit360Skill
- interpro-databaseSkill
- isolated-sandbox-environmentSkill
- jaspar-databaseSkill
- k6-load-testingSkill
- lightweight-dep-managerSkill
- literature-search-arxivSkill
- literature-search-biorxivSkill
- literature-search-europepmcSkill
- literature-search-openalexSkill
- maestro-hadi-orchestrationSkill
- majlis-rulesSkill
- marketing-funnel-skillSkill
- ncbi-sequence-fetchSkill
- neuro-marketing-copywriterSkill
- nuclei-security-auditorSkill
- openfda-databaseSkill
- opentargets-databaseSkill
- owasp-zap-api-shieldSkill
- pdb-databaseSkill
- premium-visual-polish-skillSkill
- protein-sequence-msaSkill
- protein-sequence-similarity-searchSkill
- psychological-copywriting-skillSkill
- The first 60 shown.
The file
Files
مهارة تنظيف المستندات من الطبقات المضللة (PDF Scan Layer Cleaner)
Agent Metadata & Team Identity
- اسم الوكيل: 🧰 مبتكر (Agent 20) / 💻 فارس (Agent 15)
- الإيموجي: 🧹📄
- التسلسل الفني في الفريق: Agent 20
- الموقع في خط الإنتاج: المعالجة الفنية والتجهيز المسبق للكتب والمستندات الرقمية (Pre-processing & Clean-up)
- طريقة وسلسلة العمل:
- فحص البنية الهيكلية لتدفقات PDF (Streams).
- عزل وحذف تدفق صورة خلفية الورق الرمادية (
fzImg0/<Non-Native Art>). - الإبقاء على تدفق صورة النص الحقيقي الحاد (
fzImg1/<Image>). - الإبقاء على طبقة النص المخفي (
3 Tr/GlyphLessFont) للبحث والتحديد بدون رسم مستطيلات سوداء.
Prerequisites
- تثبيت مكتبة Python PyMuPDF (
fitz):
pip install pymupdf- وجود ملف الـ PDF الممسوح ضوئياً ذي الطبقات المتعددة.
Overview
تُستخدم هذه المهارة عند معالجة كتب ومستندات PDF الممسوحة ضوئياً عبر برامج مثل Adobe Acrobat OCR أو FineReader والتي تُنشئ طبقتين من الصور لكل صفحة:
- الصورة الأولى (
fzImg0/ خلفية الورق): تظهر في Illustrator كـ<Non-Native Art>أو<Clipping Path>وتكون ذات لون رمادي أو أصفر وممتلئة بالشوائب. - الصورة الثانية (
fzImg1/ حبر الكلمات): تظهر في Illustrator كـ<Image>وتضم النص الحقيقي الناصع. - طبقة OCR (
3 Tr/GlyphLessFont): خط غير مرئي لتحديد الكلمات.
تحذير حاسم (Do NOT use when):
- يمنع تحويل
3 Trإلى0 Trللمستندات التي تستخدم خطوطGlyphLessFontلأن ذلك يؤدي لرسم مستطيلات سوداء كاملة بدلاً من الحروف.
Setup (Agent Instructions)
- قراءة تدفقات الصفحة (
page.get_contents()). - تحديد تدفق الصورة الأولى (الخلفية الرمادية) وإفراغه عبر
doc.update_stream(xref, b''). - إعادة حفظ المستند بخيار
garbage=4, deflate=True, clean=True.
Core Rules
- [قاعدة 1 - الاحتفاظ بالحبر النقائي]: لا تحذف صورة النص
fzImg1بل احذف فقط صورة خلفية الورقfzImg0. - [قاعدة 2 - حماية طبقة التحديد]: اترك وضعية
3 Trكما هي لتوفير إمكانية النسخ والبحث دون تخريب الشكل البصري. - [التحقق ما قبل التشغيل Pre-Flight Check]: افحص قيم البيكسلات بعد المعالجة وتأكد من أن المتوسط المتري يقترب من 250 (أبيض ناصع) وأن الحبر الأسود موجود ومقروء.
Quick Start
Minimal example script (clean_pdf_layers.py)
import fitz
import sys
def clean_pdf_layers(input_pdf_path, output_pdf_path):
doc = fitz.open(input_pdf_path)
print(f"إجمالي الصفحات: {len(doc)}")
for i, page in enumerate(doc):
contents = page.get_contents()
if len(contents) >= 3:
# Stream 0: /fzImg0 Do (خلفية الورق الرمادية)
first_xref = contents[0]
first_stream = doc.xref_stream(first_xref)
if b'fzImg0' in first_stream or b'Do' in first_stream:
doc.update_stream(first_xref, b'')
# حذف مرجع الصورة إن أمكن
for img in page.get_images():
if img[7] == 'fzImg0':
try:
page.delete_image(img[0])
except Exception:
pass
doc.save(output_pdf_path, garbage=4, deflate=True, clean=True)
print(f"تم حفظ المستند المنظف بنجاح: {output_pdf_path}")
if __name__ == "__main__":
clean_pdf_layers("input.pdf", "cleaned_output.pdf")Common Recipes
- تفريغ خلفية المسح الرمادية — لحذف الشوائب وجعل الخلفية بيضاء ناصعة 100%.
- تسريع وتخفيض حجم الـ PDF — تقليل الحجم دون فقدان دقة القراءة والطباعة.
- تجهيز الكتب للعرض الرقمي والطباعة 300DPI — إنتاج صفحات عالية الجودة جاهزة للمطابع.
Interpreting Output
- حجم الملف: ينخفض الملف بشكل ملحوظ عند تنظيف المراجع أو ينخفض زمن المعالجة والتحميل بنسبة تزيد عن 90%.
- الجودة البصرية: صفحات بيضاء ناصعة تماماً مع حبر أسود حاد وقابلية تامة للنسخ والبحث.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

