a program that saves printer toner
  • Python 99.3%
  • Shell 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Luna ae332461d6
Fix zine tab Save As crashing with NameError
A cleanup edit replaced the save dialog call, so _save referenced an
undefined name and PyQt aborted the app. Restore the dialog and cover
saving from the zine tab with a GUI test.
2026-10-09 19:23:22 -07:00
assets/icons/hicolor/scalable/apps Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
debian Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
docs/superpowers Initial Tonersave release under GPLv3 2026-08-31 16:20:31 -07:00
python_src/zinekit Fix zine tab Save As crashing with NameError 2026-10-09 19:23:22 -07:00
scripts Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
tests Fix zine tab Save As crashing with NameError 2026-10-09 19:23:22 -07:00
.gitignore Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
AGENTS.md Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
CLAUDE.md Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
LICENSE Initial Tonersave release under GPLv3 2026-08-31 16:20:31 -07:00
MANIFEST.in Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
PKGBUILD Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
pyproject.toml Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
README.md Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00
zinekit.desktop Revamp tonersave into the zinekit suite with a zine booklet imposer 2026-10-09 19:18:48 -07:00

zinekit

zinekit is a set of zine distro tools for turning PDFs into printable zines. Every tool works on the PDF itself rather than rasterising pages, so text remains selectable and vector art remains sharp.

  • zinekit zine imposes a reading-order PDF (a web article, an ebook, a screen-layout zine) as a saddle-stitched, short-edge-flip booklet.
  • zinekit toner lightens dark inks, removes large dark vector backgrounds, and optionally lightens or removes full-page dark images. Pale content and ordinary photos are normally left alone.

Install

pip install -e '.[gui,dev]'

Python 3.11+ is required. Poppler's pdftoppm enables --stats and GUI previews; conversion and imposition do not depend on it.

Zine booklets

zinekit zine article.pdf article-zine.pdf
zinekit zine novel.pdf novel-zine.pdf --sheet a4 --signature 5
zinekit zine article.pdf article-zine.pdf --margin 18

Each source page is scaled to fit half of a landscape sheet side, keeping its aspect ratio. Print the result double-sided, flip on short edge, stack the sheets in order, and fold the stack in half: the pages read in their original order. The page count is padded with blank pages at the end to a multiple of four.

--sheet is letter (default), legal, tabloid, a4, or a3. --margin keeps that many points clear on every edge of each page (default 0, because most web PDFs already carry margins). --signature N folds every N sheets as a separate nested stack for sewing thick booklets; without it the whole document is one stack. Printable annotations such as filled form fields are burned into the pages; links and other screen-only annotations are dropped.

Toner saving

zinekit toner report.pdf report-eco.pdf
zinekit toner report.pdf report-eco.pdf --stats --verbose
zinekit toner slides.pdf slides-eco.pdf --preset aggressive
zinekit toner report.pdf --in-place --pages 1-4
zinekit toner report.pdf report-eco.pdf --strict

Useful options: --gray controls retained black ink for text and vector marks (default 0.35); --image-gray independently controls retained black ink for raster images (and otherwise follows --gray), --no-backgrounds and --no-images disable their matching reductions, --image-mode is lighten or drop, --image-area sets the minimum image coverage fraction (use 0 to consider every image placement), and --image-darkness controls the normal image brightness gate. --bg-area sets the fraction a fill must occupy before it is treated as a background. --preserve-text keeps native and scanned text at its original ink level while still reducing backgrounds, vector graphics, and raster artwork.

When the text and image ink levels differ, --mask-mode decides which pixels inside a raster image count as text. The default detail keeps dark strokes narrower than --detail-width (in points, default 2.0) at the text level and reduces wider ink masses, so fine print stays crisp while solid artwork lightens; it needs no OCR and is resolution-independent. ocr instead asks Tesseract which words it can read, which is more literal but misses stylized lettering and requires tesseract to be installed. none applies --image-gray to every pixel of an image. Shared images are lightened only once. --verbose reports what was changed, including recognized scans, skipped images, and a reason for each failed page. --strict refuses to write an output when any selected page cannot be converted. In-place conversion preserves the source mode, timestamps, and supported extended attributes (including filesystem ACLs where they are represented as xattrs).

Exit codes for both tools are 0 for success, 1 for conversion failure, and 2 for invalid arguments.

GUI

zinekit-gui report.pdf (or python -m zinekit.gui) opens one tab per tool. The zine tab previews the front and back of each imposed sheet. The toner tab presents the original and converted page side by side, so each preview shows the actual print-visible effect of the selected settings.

Limitations

Tiling-pattern contents are processed, while shading patterns, Separation, and DeviceN constructs are left untouched. Page-level inline images are externalized and then processed through the same safe image pipeline as regular image XObjects. A shared Form XObject is rewritten only once, using the first placement transform observed. Large neutral scans with material sampled ink coverage are lightened even when their paper makes their average brightness appear close to white; bright colour artwork is still left untouched by the normal profile.

See docs/superpowers/specs/2026-08-19-tonersave-design.md for the toner design.

License

zinekit is free software licensed under the GNU General Public License, version 3 only. See LICENSE for the complete terms.