Convert CBZ comics to XTC for XTEink X4 — pip-installable CLI and library
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cbz2xtc-0.1.0.tar.gz.
File metadata
- Download URL: cbz2xtc-0.1.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c95f4b627299cee568395dddbf7adbf86e60f9aa2d78557c3c7d1605b315596
|
|
| MD5 |
436a2d00cdaffc3bca0532a65ebf5367
|
|
| BLAKE2b-256 |
37f30fe87aa6bbb6cb644058a8fb2bde1fc77bc0975bcd9c771f44ece1373d6f
|
Provenance
The following attestation bundles were made for cbz2xtc-0.1.0.tar.gz:
Publisher:
publish.yml on donutboyy/cbz2xtc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cbz2xtc-0.1.0.tar.gz -
Subject digest:
6c95f4b627299cee568395dddbf7adbf86e60f9aa2d78557c3c7d1605b315596 - Sigstore transparency entry: 1653211679
- Sigstore integration time:
-
Permalink:
donutboyy/cbz2xtc@f57d17f7c9cb3b2759a3529eff69d60a80b1fdbf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/donutboyy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f57d17f7c9cb3b2759a3529eff69d60a80b1fdbf -
Trigger Event:
release
-
Statement type:
File details
Details for the file cbz2xtc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cbz2xtc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c66cb7b25d888d30477489b3ba6a9541b3f2319468ae72dfebec40cb305f165
|
|
| MD5 |
ba8f52619d89a8f143dc6ce5b91803ba
|
|
| BLAKE2b-256 |
2b9cf9ab9188dcb6002ad9794e5c20a929b1ab417a2ca6a2ba101bb4c7988826
|
Provenance
The following attestation bundles were made for cbz2xtc-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on donutboyy/cbz2xtc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cbz2xtc-0.1.0-py3-none-any.whl -
Subject digest:
5c66cb7b25d888d30477489b3ba6a9541b3f2319468ae72dfebec40cb305f165 - Sigstore transparency entry: 1653211928
- Sigstore integration time:
-
Permalink:
donutboyy/cbz2xtc@f57d17f7c9cb3b2759a3529eff69d60a80b1fdbf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/donutboyy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f57d17f7c9cb3b2759a3529eff69d60a80b1fdbf -
Trigger Event:
release
-
Statement type: