Pptx Compressor banner
ystyleb ystyleb

Pptx Compressor

Design community

Description

Shrink .pptx files by 50-70% without touching slides, layout, animations, or embedded fonts. A Claude Code Skill (and plain Python CLI) that re-encodes videos with ffmpeg, optimizes images with Pillow, and safely patches PNG->JPG rels.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

pptx-compressor

Shrink a bloated `.pptx` file by 50–70% without touching a single slide, word, layout, animation, or embedded font.

This is a [Claude Code Skill](https://docs.claude.com/en/docs/claude-code/skills), but the underlying script is a plain Python CLI you can use standalone.

What gets compressed — and what doesn't

A `.pptx` is a ZIP archive. The slide markup (XML) is a few hundred KB at most; the bulk is almost always embedded media. This tool only touches media:

Asset Action
Videos (.mp4) Re-encoded with ffmpeg, H.264, configurable CRF
JPEGs Re-encoded at configurable quality, optionally downsampled to 1920px
PNGs (with real alpha) Optimized in place, kept as PNG
PNGs (no alpha) — aggressive mode only Converted to JPEG; [Content_Types].xml and all .rels references patched
Slide XML, animations, themes, charts, tables Not touched
Embedded fonts (ppt/fonts/*.fntdata) Not touched — removing them causes layout drift on machines without the same fonts

Real result from a 262 MB presentation with 2 videos, 168 images and 13 embedded fonts:

Before : 262.0 MB
After  :  81.0 MB   (-69.1%)
Stats  : Stats(jpeg=30, png_keep=35, png_to_jpg=123, videos=2, skipped=15, errors=0)

Installation

As a Claude Code Skill

git clone https://github.com/ystyleb/pptx-compressor ~/.claude/skills/pptx-compressor

Then in Claude Code, any mention of "compress PPT", "PPTX 太大", "shrink this deck" etc. will invoke the skill.

As a plain Python CLI

git clone https://github.com/ystyleb/pptx-compressor
cd pptx-compressor
pip install Pillow
# macOS
brew install ffmpeg
# Debian/Ubuntu
# sudo apt install ffmpeg

python3 scripts/compress_pptx.py path/to/deck.pptx

Requirements

  • Python 3.9+
  • Pillowpip install Pillow
  • ffmpeg on PATH (skip with --skip-video if the deck has no videos)

Usage

pyt