Converts a static image into an editable .pptx file where every text element is a selectable, editable text box over a clean inpainted background.
ScenarioRecommendationSlide with text on solid/flat backgroundBest resultsSlide with photo backgroundGood — uses inpainting (warn about overlap areas)Slide with solid backgroundGood — use --skip-inpaint for speedChinese/multilingual slideGood — ch OCR handles both Chinese and EnglishPoster or infographic with textGood — works well if text is separate from graphicsDense chart with axis labels on barsCaution — line grouping may over-merge crowded labelsVery thick/large decorative fontsCaution — may exceed standard mask dilation rangeExtract individual assets as PNGsNo — use px-asset-extractRead text without creating PPTXNo — use OCR directlyEdit an existing .pptx fileNo — use the pptx skill
bash
git clone https://github.com/JadeLiu-tech/px-image2pptx.git
cd px-image2pptx
pip install -e ".[all]"
bash
px-image2pptx slide.png -o output.pptx
px-image2pptx slide.png -o output.pptx --lang ch
px-image2pptx slide.png -o output.pptx --skip-inpaint
px-image2pptx slide.png -o output.pptx --ocr-json text_regions.json
px-image2pptx slide.png -o output.pptx --work-dir ./debug/
python
from px_image2pptx import image_to_pptx
report = image_to_pptx("slide.png", "output.pptx")
# With options
report = image_to_pptx(
"slide.png", "output.pptx",
lang="ch",
skip_inpaint=False,
work_dir="./debug/",
)
OptionDefaultDescription-o, --output``output.pptxOutput PPTX path--ocr-jsonPre-computed OCR JSON (skips OCR)--lang``autoOCR language: auto, en, ch``--sensitivity``16Textmask sensitivity (lower = more)--dilation``12Textmask dilation pixels--min-font``8Min font size in points--max-font``72Max font size in points--skip-inpaintSkip LAMA inpainting--work-dirSave intermediate files
Downloaded automatically on first use (~370 MB total). All models are from official open-source repositories.
ModelSizeLicenseSourcePP-OCRv5_server_det84 MBApache 2.0PaddlePaddle/PaddleOCRPP-OCRv5_server_rec81 MBApache 2.0PaddlePaddle/PaddleOCRbig-lama196 MBApache 2.0advimman/lama
Models are cached locally after first download ( ~/.paddlex/official_models/ for OCR, ~/.cache/torch/hub/checkpoints/ for LAMA). To skip model downloads entirely, use --ocr-json with pre-computed OCR and --skip-inpaint.
InputImpactWhat to tell the userText on solid/flat backgroundBest resultsNo caveats neededText on textured backgroundGood resultsLAMA handles repeating textures wellText overlapping photosInpainting artifacts likely"Areas where text covers photos may show blurring"Dense chart with many labelsOver-merged labels"Crowded labels may be grouped incorrectly"Very thick/large fontsIncomplete mask coverage"Large fonts may exceed dilation range — try increasing --dilation"Light text on dark backgroundBlockier inpainting"White-on-dark text uses box masks instead of tight ink masks"WebP imageOCR fails (0 regions)Convert to PNG first: Image.open("in.webp").save("in.png")Very large image (>4000px)Slow inpaintingSuggest --skip-inpaint or downscalingDecorative/handwritten fontsTypeface won't match"Fonts are reconstructed as Arial/Helvetica"Centered/justified textLeft-aligned output"Text alignment is not preserved"