Freelance & client workOwnerJul 2026

Redwings PDF Tools: desktop PDF compressor and toolkit

TL;DR

Visa documents must fit strict upload limits. This desktop tool compresses PDFs with several modes and uses a binary search to find the sharpest output under a target size.

Period
Jul 2026
My role
Solo: engine, GUI and packaging
Technologies
4
Diagrams
1
Reading time
1 min

PythonPDF & document generationDesktop GUI (Tk / Qt)SQLite

1 chapter(s) collapsed in quick read

Summary

The engine analyses each PDF (text vs scanned, bitonal suitability, DPI) and chooses or applies a compression strategy:

  • Tier A lossless (pikepdf optimise)
  • Tier B image downsample / re-encode (PyMuPDF, optional Ghostscript)
  • Tier C bitonal 1-bit (CCITT / PNG) for text scans
  • MRC two-layer mixed raster content (ABBYY-style)

Modes are precision (Adobe-like, text-safe), balanced (Wondershare-like), maximum (ABBYY-like) and auto. Strength is level 1–5, a quality override, or a target size, which triggers a binary search for the sharpest result under the limit. Groups escalate compression across files until the bundle fits. Every version is kept with an “under target” badge. Results, recent files, sessions and templates are stored in SQLite. The UI was built first in Tkinter (themed, light / dark) and then ported to PySide6 (Qt) with background workers, a cancel / stop button and timers.

Stack

PyMuPDF 1.28, pikepdf 10.10, pypdf 6.14, Pillow 12.3, PySide6 6.11, Tkinter / ttk (legacy UI), SQLite (db.py), optional Ghostscript (gswin64c), PyInstaller (RedwingsPDFTools.spec, build_exe.cmd, app icon), pyright config, headless engine smoke test.

Architecture

app/
├─ config.py (colours, fonts, paths, MODE / LEVEL tables) · theme.py · utils.py · models.py (CompressionSettings, DocFile, Group, Template) · db.py · logging_setup.py · templates_def.py
├─ engine/ detect (capabilities) · analyze (text / scan / DPI, auto mode) · pdf_ops (shuffle / merge / split / rotate / reorder)
│ tier_lossless · tier_image · tier_bitonal · tier_mrc · render · compress (orchestrator + target search) · pipeline (group escalation) · cancel
├─ qt/ main_window, compressor_page (794), template_page (689), tools_pages, settings_page, preview_dialog, template_editor_dialog, widgets, flowlayout, workers (QThread), theme, dialogs
└─ ui/ (Tkinter) app, compressor_view, template_view, preview, merge / shuffle / split views, filelist, widgets
Architecture
Diagram as text
flowchart LR
 F[PDFs / group] --> AN[analyze: text vs scan, DPI, bitonal]
 AN --> MODE{mode}
 MODE --> TA[Tier A lossless]
 MODE --> TB[Tier B image re-encode / Ghostscript]
 MODE --> TC[Tier C bitonal]
 MODE --> MRC[MRC two-layer]
 TA & TB & TC & MRC --> SEARCH[target-size binary search on quality]
 SEARCH --> OUT[versions + under-target badge → Documents/redwings-pdftools]
 OUT --> DB[(SQLite results / sessions)]

Resume Bullet

Built a PySide6 desktop PDF toolkit with an adaptive multi-tier compression engine (lossless, image, bitonal, MRC) and target-size binary search, packaged with PyInstaller for a visa agency.

Related projects

Want to discuss this project?

Happy to walk through the architecture, trade-offs or the code.

Email me about it

© 2026 Thuyavan Sivarasa. Script code is MIT licensed.