Skip to content

Repository files navigation

🖼️ Image2PPT — Turn any image into an editable PowerPoint

Image2PPT

Not "insert picture into a slide". Image2PPT OCRs your image, then rebuilds it as a real, editable .pptx — text becomes editable text boxes (original font size & color preserved), and non-text areas (charts, photos, icons, colored blocks) become draggable picture modules. Every block can be moved, resized, and edited in PowerPoint/Keynote/WPS.

pipeline


✨ Why Image2PPT

Slides are meant to be edited. But when your content lives inside a screenshot, a UI mockup, an infographic, or a scanned page, it's frozen pixels. Image2PPT breaks that frozen image back into real PowerPoint objects:

  • 🔤 Real text, not pictures of text — OCR extracts each text line and writes it as a genuine editable text box.
  • 🎯 Faithful reconstruction — original font size, color, and position are recovered, so the slide looks like the source.
  • 🧩 Draggable picture modules — charts, photos, icons, and color blocks are sliced into independent, movable picture shapes.
  • 🧠 Conservative text grouping — only same-size, same-aligned, same-color adjacent lines merge, so you never get one giant mixed blob.
  • 🪄 Nothing lost — the whole image is kept as a clean base layer (OCR text is inpainted out), guaranteeing 100% visual fidelity.
  • 🌐 High-accuracy OCR — powered by RapidOCR (ONNX), strong on both Chinese and English.
  • 🖱️ Zero-friction UX — drag & drop web UI, batch conversion, one-click download. Or use it as a CLI / library.

🚀 Features

OCR engine RapidOCR (ONNX) — Chinese + English
Output Native .pptx (editable text + pictures)
Text fidelity Font size, color, and position preserved
Picture modules Connected-component slicing → draggable shapes
UI Local web app (Flask + drag & drop), batch mode
Library converter.convert(image, pptx)
Packaging One-click Windows .exe (no Python needed)
Platform Source runs anywhere Python 3.10+ runs

📦 Installation

Option A — Windows, no Python required ⭐

  1. Go to Releases and download Image2PPT-win64.zip.
  2. Unzip anywhere.
  3. Double-click image2ppt.exe — a browser tab opens automatically.

Option B — From source (any OS with Python 3.10+)

git clone https://github.com/dlinjiade-debug/Image2PPT.git
cd Image2PPT
pip install -r requirements.txt
python app.py            # opens the web UI at http://127.0.0.1:5000

Build a standalone Windows executable (Windows only):

python build_exe.py      # produces image2ppt/image2ppt.exe

🖱️ Usage

Web UI — open the app, drag in one or more images (PNG / JPG / BMP / WEBP), click Convert, then download the generated .pptx. Each image becomes its own presentation.

Command line / library

# CLI
python converter.py input.png output.pptx

# Library
from converter import convert
summary = convert("input.png", "output.pptx")
print(summary["text_blocks"], summary["image_modules"])

Open the resulting .pptx in PowerPoint, WPS, or Keynote — every text box and picture is a normal, editable object.

🛠️ How it works

  1. OCR — RapidOCR detects text and returns each line with its polygon and script.
  2. Inpaint — detected text is removed from the original image, leaving a clean base layer.
  3. Cluster — text lines are grouped conservatively (same size + alignment + color) into editable text boxes with recovered font size and color.
  4. Slice — remaining content goes through connected-component analysis; large non-text regions become draggable picture modules.
  5. Compose — the base image, editable text, and picture modules are layered into a single .pptx.

See assets/pipeline.svg for the visual flow.

📂 Project structure

Image2PPT/
├── app.py              # Flask web UI (drag & drop, batch, download)
├── converter.py        # Core engine: OCR → inpaint → cluster → slice → pptx
├── build_exe.py        # One-click Windows executable builder
├── templates/          # Web UI template
├── assets/pipeline.svg # Architecture diagram
├── examples/           # Sample input + generated .pptx
├── requirements.txt
└── LICENSE

💡 Tips for best results

  • Screenshots, UI mockups, and text-rich infographics convert best.
  • Higher resolution + clear contrast = better OCR.
  • For a long image that packs many pages, crop it into single pages first.

🗺️ Roadmap

  • Multi-page / long-image auto-split into multiple slides
  • Table-structure recovery
  • Layout beautification (smart alignment & spacing)
  • Prebuilt packages for Linux & macOS

🤝 Contributing

Pull requests and issues are welcome! For large changes, please open an issue first to discuss direction.

📄 License

Released under the MIT License. OCR models are provided by RapidOCR (Apache-2.0).

About

Turn any image into an editable, modular PowerPoint (.pptx). OCR text becomes editable text boxes; charts/photos become draggable picture blocks. Powered by RapidOCR.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages