cbz2xtc
Convert CBZ comics to XTC for the XTEink X4 e-reader.
Community-maintained successor inspired by tazua/cbz2xtc, packaged for PyPI with a native XTC encoder — no external png2xtc.py or git clone required.
Status
v0.1.0 — CBZ→XTC pipeline, full legacy CLI parity, and tiered programmatic tests are in place.
Scope
In scope: CBZ in, XTC out — CLI and importable library for the XTEink X4.
Out of scope for v0.1.0:
legacy/image2bw.py(BMP wallpaper conversion) — reference only; may become a separate subcommand later- EPUB/PDF conversion
- Byte-exact golden-file regression tests
See docs/design.md for behavioral decisions and the v0.1.0 release bar.
Install
pip install cbz2xtc
Input format
A CBZ file is a ZIP archive of images (PNG, JPEG, GIF, BMP, or WebP). Pages are processed in sorted zip entry order (by filename inside the archive).
Migrating from tazua/cbz2xtc
CLI flags match the legacy tazua/cbz2xtc tool. Install with pip — no png2xtc.py, epub2xtc clone, or separate git checkout required.
CLI usage
Convert every .cbz in a directory (searches immediate subdirectories if none are found in the root):
cbz2xtc /path/to/manga
Output lands in xtc_output/ beside the input; intermediate PNGs go under .temp_png/.
Copy xtc_output/*.xtc to your XTEink X4 to read them.
Common options (full list: cbz2xtc --help):
cbz2xtc /path/to/manga --clean # remove temp PNGs after conversion
cbz2xtc /path/to/manga --no-dither # sharper line art (encoder thresholds at 200)
cbz2xtc /path/to/manga --skip 2,3 # skip pages
cbz2xtc /path/to/manga --only 1 # convert page 1 only
cbz2xtc /path/to/manga --margin 5 # crop margins (percent)
cbz2xtc /path/to/manga --pad-black # black padding instead of white
cbz2xtc /path/to/manga --split-spreads all # split horizontal spreads
Exit code 0 when all conversions succeed; 1 if any fail or no CBZ files are found.
Library usage
from pathlib import Path
from cbz2xtc import BatchResult, ConvertOptions, ConversionResult, convert_directory, convert_file
# Single file
result: ConversionResult = convert_file(
Path("chapter.cbz"),
options=ConvertOptions(clean_temp=True, dither=False),
)
if result.success:
print(result.output_path)
# Directory batch (parallel when multiple CBZ files)
batch: BatchResult = convert_directory(
Path("./manga"),
options=ConvertOptions(clean_temp=True, max_workers=4),
)
print(batch.succeeded, batch.failed)
Library-only ConvertOptions fields (no CLI flags in v0.1.0):
target_width/target_height(default 480×800)max_workers— parallel CBZ processing
For development, testing, CI, and releases, see CONTRIBUTING.md.
License
MIT — see LICENSE.
Attribution
- Inspired by tazua/cbz2xtc and community contributions
- XTC format reference: phrozen/xtx SPEC
- No code from unlicensed epub2xtc is included
Release files for cbz2xtc 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cbz2xtc-0.1.0.tar.gz | 20.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cbz2xtc-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.4 kB
Release files / cbz2xtc-0.1.0.tar.gz
| Download URL | cbz2xtc-0.1.0.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c95f4b627299cee568395dddbf7adbf86e60f9aa2d78557c3c7d1605b315596
|
|
BLAKE2b-256 checksum How to use checksums |
37f30fe87aa6bbb6cb644058a8fb2bde1fc77bc0975bcd9c771f44ece1373d6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 28, 2026.
Transparency logRelease files / cbz2xtc-0.1.0-py3-none-any.whl
| Download URL | cbz2xtc-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c66cb7b25d888d30477489b3ba6a9541b3f2319468ae72dfebec40cb305f165
|
|
BLAKE2b-256 checksum How to use checksums |
2b9cf9ab9188dcb6002ad9794e5c20a929b1ab417a2ca6a2ba101bb4c7988826
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 28, 2026.
Transparency log