- Python 99.3%
- Shell 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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. |
||
| assets/icons/hicolor/scalable/apps | ||
| debian | ||
| docs/superpowers | ||
| python_src/zinekit | ||
| scripts | ||
| tests | ||
| .gitignore | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| LICENSE | ||
| MANIFEST.in | ||
| PKGBUILD | ||
| pyproject.toml | ||
| README.md | ||
| zinekit.desktop | ||
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 zineimposes a reading-order PDF (a web article, an ebook, a screen-layout zine) as a saddle-stitched, short-edge-flip booklet.zinekit tonerlightens 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.