Community이미지github.com

ky-ppt

科研图/示意图本地免费重建为可编辑 PowerPoint(PPTX) 或 Adobe Illustrator(AI) 文件;另支持 PDF→科研汇报 PPT(深紫文献解读风:编号徽章、结论式标题、并排证据卡、已有/待证局限页、页底总结条;多子图 A/B/C/D 自动拆分分组进卡)。vtracer 平滑矢量化(默认)/ OpenCV 量化双引擎 + RapidOCR 自动文字清单(可选小 VLM 分区语义)+ PyMuPDF 解析 + 内置开源绘图后端,无需 API Key、零费用。当用户要求"把这张图转成可编辑PPT/AI"、"科研图矢量化"、"PDF 转汇报 PPT"、"文献解读 PPT"、"图片转原生形状"、"用 ky_ppt/ky-ppt 处理这张图"时使用。扁平色块与密集科研流程图均适用,照片类复杂图像效果有限。

ky-ppt란 무엇인가요?

ky-ppt is a Claude Code agent skill that 科研图/示意图本地免费重建为可编辑 PowerPoint(PPTX) 或 Adobe Illustrator(AI) 文件;另支持 PDF→科研汇报 PPT(深紫文献解读风:编号徽章、结论式标题、并排证据卡、已有/待证局限页、页底总结条;多子图 A/B/C/D 自动拆分分组进卡)。vtracer 平滑矢量化(默认)/ OpenCV 量化双引擎 + RapidOCR 自动文字清单(可选小 VLM 分区语义)+ PyMuPDF 解析 + 内置开源绘图后端,无需 API Key、零费用。当用户要求"把这张图转成可编辑PPT/AI"、"科研图矢量化"、"PDF 转汇报 PPT"、"文献解读 PPT"、"图片转原生形状"、"用 ky_ppt/ky-ppt 处理这张图"时使用。扁平色块与密集科研流程图均适用,照片类复杂图像效果有限。.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jiang-keyi/ky_ppt/tree/HEAD

Installed? Explore more 이미지 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

ky_ppt

Image → editable PPTX / AI, fully local zero-cost. Three-tier architecture:

  1. Geometry Engine (--engine): Default vtracer (vectorize_vtracer.py, Rust O(n) color stacking + spline fitting, smooth curves, gradient fidelity); Optional opencv (vectorize_local.py, two-stage palette quantization + contours, suitable for pure flat color blocks, use --merge-colors for minimal shapes).
  2. Text/Semantic Layer (optional): Default RapidOCR (ocr_manifest.py, --ocr-manifest, CPU seconds) for precise OCR + text positioning, automatically generates text-manifest, eliminating manual coordinate recording; Optional local Ollama small VLM (vlm_semantics.py, default qwen3-vl:2b) for short semantic tasks like region/title (--mode regions). Note: 2B-level VLM is unstable for dense image character-level bbox OCR; prefer RapidOCR for precise text manifest.
  3. Drawing Backend: Built-in drawing backend (MIT, see LICENSE), geometry + text manifest → native editable PPTX/AI.

Standard Workflow (Research Figures with Text)

  1. Text Manifest (choose one of three):
    • Automatic OCR (recommended): Add --ocr-manifest in step 3. RapidOCR will accurately identify text + bboxes on the original image with text, automatically generating text-manifest.json (CPU seconds, auto-estimates font size/color). If geometry uses a de-texted image, first run ocr_manifest.py --input-image original.png --output text-manifest.json separately, then pass it via --text-manifest to avoid text being baked in twice.
    • Automatic VLM (short semantics): With local Ollama running and ollama pull qwen3-vl:2b, add --vlm-manifest (CPU minutes, suitable for short text like titles/regions; less reliable than RapidOCR for dense character-level OCR).
    • Manual: Read references/text-workflow.md. Record each text's content, pixel coordinates (y is baseline), font size, and color into text-manifest.json (schema_version "1.0", source_canvas as original image width/height, coordinate_space "pixels").
  2. De-text: Use any available image editing model to clear only the text (including watermarks), obtaining a cleaned image. Verify against the original that shapes, layout, colors, lines, and canvas remain unchanged; re-run cleanup if they changed.
  3. Local Reconstruction (zero cost, no payment confirmation needed):
py -3 -X utf8 <skill>/scripts/run_local.py --input-image cleaned.png --text-manifest text-manifest.json --output-root <output directory> --application ppt
  • Default --engine vtracer (better curves/colors); for pure flat color blocks desiring minimal shape count, use --engine opencv --merge-colors.

  • Without a manual manifest, add --ocr-manifest (recommended, RapidOCR) or --vlm-manifest (Ollama) for automatic generation.

  • Use the original resolution from the de-text model, do not downscale beforehand (fine lines and small details will blur). If the resolution differs from the original image, the manifest's source_canvas should still use the original size; coordinates are automatically mapped proportionally.

  • Text layer order is forced on top by code; no need to manually ensure paint_order in the manifest.

  • Output: <output directory>\shibielujingN\shibielujingN.pptx (native editable shapes + text boxes), same directory retains master SVG, geometry cache, and text-manifest.json.

  1. Validation: Use python-pptx to count freeform/text box counts; visually check by exporting PNG from PowerPoint COM and comparing with original. For white canvas issues, first read references/white-overlay-diagnostics.md.

For images without text: skip steps 1-2 and go directly to step 3. For an already approved SVG: use scripts/run_from_svg.py --input-svg ....

PDF → Research Presentation PPT (pdf_to_deck branch)

Organizes a PDF into a set of white-background academic blue presentation PPTs, independent of the "single image → editable shapes" pipeline above.

  • Entry scripts/pdf_to_deck.py: PyMuPDF extracts title/sections/paragraphs/embedded images/tables → outline → python-pptx academic template output (cover / table of contents / section page / key points page / results page / summary).
  • Multi-panel Splitting scripts/split_panels.py: White-space projection cuts A/B/C/D composite figures into individual panels by row/column; RapidOCR only helps identify panel letters; if unrecognized, panels are numbered by row/column order. Panels must be separated by white space/blank space. Splitting is only for grouping into cards; never use one image per page.
  • Default Style (learned and frozen from user references): Deep purple literature review style (main color #7D2E68, light purple #F3E8F2, white background), see references/deck-style-guide.md for details. Main slide types:
    • evidence slide: Deep purple full-width title bar + white circle numbered badge + white theme word → bold black leading sentence (keywords emphasized in purple) → 1–3 side-by-side evidence cards (purple background white text keyword label + full multi-panel composite figure + light purple conclusion bar) → bottom light purple summary bar (process-style "loading → migration → targeting → treatment" or sample size/measurement).
    • limitations slide: Arrow-shaped purple label + "Had: … (black) / Yet-to-prove: … (purple)" contrasting lines.
    • Titles must be conclusion-type with numbers (e.g., "Infarct volume reduced by 26.7%"), retain qualifiers like "not quantified / still pending".
  • Image/Text Rules: Card composite figures embedded as bitmaps, scaled proportionally without cropping; --vectorize-figures is a reserved hook for future conversion of panels via vtracer into editable shapes.
  • Outline Source:
    • --outline outline.json: Assistant fills in a refined outline (titles/key points/figure captions/speaker notes) after reading the PDF; best quality;
    • Without --outline: Offline fallback extracts sentences per section, faithful but dry.
# Offline fallback: PDF direct output
py -3 -X utf8 scripts\pdf_to_deck.py --pdf paper.pdf --output out\deck.pptx

# Assistant outline-driven: First write outline.json, then output
py -3 -X utf8 scripts\pdf_to_deck.py --outline outline.json --output out\deck.pptx

Outline schema (v1.0): {"title","authors","color":{"primary",...},"slides":[{"type":"cover|toc|section|content|evidence|limitations|result|figure|table|conclusion","title","bullets","image","image_caption","table","notes"}]}. evidence slide: {"type":"evidence","number","title","lead","cards":[{"label","image","caption"}],"summary"}; limitations slide: {"type":"limitations","number","title","cards":[{"label","have","todo"}]}. When writing the outline, the assistant should semantically group panels of the same argument into the same card, and extract keyword labels and concluding short sentences for each card.

Limitations: Long papers' key point refinement depends on the assistant/LLM; the pure offline sentence extraction does not polish; complex color images and densely packed panels without white space separation have limited splitting performance.

Illustrator Branch

--application ai. Requires local installation of Illustrator and opening the target document (Windows COM / macOS AppleScript), see references/illustrator-workflow.md for details. If not installed, use scripts/run_illustrator.py --dry-run to verify geometry, or instruct the user to open the master SVG in Illustrator and save as .ai.

Quality Tuning

  • --preset auto|flat|dense: Auto-selects parameters. auto decides based on detail density and number of colors; Use flat (24 colors) for flat color block schematics, and dense (128 colors, min-area 0.5, epsilon 0.3) for dense research flowcharts/small bitmap images. Explicit --max-colors/--min-area/--epsilon/--fit-tol override presets.
  • --max-colors (default 24, max 256): Use 96-128 for complex images/gradient backgrounds
  • --min-area (default 6 px²): Reduce to 0.5-2 for broken thin lines
  • --epsilon (default 0.6 px): Smaller values yield finer detail
  • --no-smooth: Output pure polylines
  • --merge-colors: Merges same-color regions into single composite paths. Reduces PPT shape count from tens of thousands to approximately the number of colors (~130), making open/edit smoother; cost is editing by color rather than by individual element. Recommended for dense images delivered as PPT.
  • Small images (longest side <1600px): Engine automatically 2x upsamples, vectorizes, then scales coordinates back to original canvas to avoid losing 1px strokes.

Quality Gate (Must Run Before Delivery)

py -3 -X utf8 <skill>/scripts/check_quality.py --svg out.svg --source original.png

Renders back and compares to source, outputs mae and ink_recall (dark ink recall, whether text/fine lines are lost). Only deliver when ok:true; low ink_recall indicates lost text, re-run with parameter adjustments per suggestions. Renderer prefers resvg-js (npm install --prefix <skill> @resvg/resvg-js, automatically installed by setup.ps1), fallback svglib (may underestimate fidelity for complex paths; its WARN messages are for reference only).

Constraints & Security

  • SVG Contract: Pure vector, stable IDs, viewBox=canvas, composite paths retain cutouts (nonzero), bottom-to-foreground order; No gradients/CSS/raster/use. validate_vector_svg.py performs automatic validation.
  • Input Protection: Only PNG/JPEG/WebP, ≤40MP; SVG containing <!ENTITY is always rejected (entity expansion protection).
  • This skill contains no paid interfaces or network calls; do not ask for API keys.
  • Dependencies: Python 3.11+, vtracer, rapidocr-onnxruntime (automatic text manifest), pymupdf (PDF parsing), opencv-python, numpy, Pillow, python-pptx, fonttools, shapely, pypinyin, pywin32 (Windows). Install: run setup.ps1 from the repository root.
  • Optional semantic layer: Local Ollama + ollama pull qwen3-vl:2b (can run on CPU, ~2GB); only needed for --vlm-manifest/region tasks.
  • Windows PowerPoint demo playback (optional): scripts/run_ppt_path_playback.ps1, see references/powerpoint-workflow.md.

관련 스킬