PDF 图片压缩与页面移动工具
A PyQt6 desktop application to compress images inside PDF files (by DPI or long‑side scaling) and move pages within a PDF. Features real‑time before/after preview, per‑image custom settings, drag‑and‑drop support, and a bilingual (English/中文) interface.
- 主要通过 pymupdf 这个库实现(注意 1.24以后版本,用
import pymupdf不再是fitz,本项目暂用 老的 fitz写法) - 如果需要 epub 版 压缩图片工具,可前往另一个 git 仓库(sigil 插件)
- pdf 不支持
.webp,所以全部转.jpg - 支持设置预览
- 支持 dpi 或 最长边(px),支持单图片自定义
- Image compression
- Reduce file size by resizing images using maximum DPI or maximum long side (pixels)
- Adjust JPEG quality with live preview
- Global settings for all images + per‑image custom overrides
- Page moving
- Move a page range to the end of the document, with automatic ToC adjustment
- Real‑time preview
- Original vs. compressed side‑by‑side, fixed‑size preview panels
- Preview updates instantly when any slider/value changes
- Convenient workflow
- Drag & drop PDF files onto the image list
- Check/uncheck images to include/exclude them from processing
- Subset fonts before saving (optional)
- Multilingual
- Switch between English and 中文 via the menu bar; language choice is saved automatically
- Python 3.8 or higher
- pip
git clone https://github.com/fun-tailor/tool_pdf_image_compressor.git
cd tool_pdf_image_compressorpip install -r requirements.txtrequirements.txt
PyQt6
PyMuPDF
Pillow
python main.py-
Compress images
- Click Open PDF or drag a PDF onto the left panel.
- Select an image from the list to see the preview.
- Adjust global parameters (mode, DPI/side, quality) – the preview updates automatically.
- To set custom parameters for a single image, toggle Use Custom Settings and modify the sliders/values.
- Tick/untick images as needed.
- Click Compress & Save As… and choose an output path.
-
Move pages
- Switch to the Page Move tab, open a PDF, set the page range, and click Move to End & Save As….
-
Switch language
- Use the Language menu in the menu bar. The choice persists across restarts.
.
├── main.py # 入口 Application entry point, menu bar, language switching
├── compress_tab.py # Image compression tab (main UI logic)
├── move_tab.py # Page moving tab
├── worker.py # Background thread for PDF processing
├── utils.py # Helper functions (compression, pixmap, etc.)
├── assets/
│ └── screenshots/
│ └── screenshot.webp
├── README.md
└── requirements.txt
