A small, fast CBZ-to-MOBI converter for Kindle, written in Rust.
Inspired by and largely modelled after kcc (Kindle Comic Converter).
kindlecc is a stripped-down CLI for the same job — extract images from a CBZ,
process them (margin crop, auto-contrast, grayscale, resize, optional
double-page split), build a fixed-layout EPUB, and run kindlegen to produce
a MOBI with proper cover metadata for the sleep / home-screen thumbnail.
- Rust (stable, edition 2024) — install via rustup.
kindlegenon yourPATH.
Amazon discontinued kindlegen and no longer distributes it. You'll need to
fetch the last released tarball from a third-party mirror.
Arch / AUR users: the kindlegen
package handles it for you.
Gentoo (and any other distro without a package): grab the tarball that the
AUR PKGBUILD points to, extract it, and drop the binary somewhere on your
PATH. For example:
# Pull the source URL from the AUR PKGBUILD, then:
mkdir -p ~/.local/opt/kindlegen
tar -xzf kindlegen_linux_2.6_i386_v2_9.tar.gz -C ~/.local/opt/kindlegen
ln -s ~/.local/opt/kindlegen/kindlegen ~/.local/bin/kindlegen # if ~/.local/bin is on PATH
# or
sudo install -m 0755 ~/.local/opt/kindlegen/kindlegen /usr/local/bin/kindlegenVerify:
kindlegen 2>&1 | head -1
# Amazon kindlegen(Linux) V2.9 build 1028-0897292 ...From crates.io:
cargo install kindleccOr build from source (in this repo):
cargo install --path .Either way, the kindlecc binary lands in ~/.cargo/bin/ (make sure it's on
your PATH). Re-run with --force to upgrade.
kindlecc INPUT [INPUT...] [OPTIONS]INPUT is one or more .cbz files, or directories containing .cbz files.
Convert a single volume:
kindlecc ~/manga/HunterXHunter-v01.cbzConvert a whole directory into a separate output folder:
kindlecc ~/manga/HunterXHunter -o ~/manga-mobiLeft-to-right reading (default is right-to-left for manga):
kindlecc -l ~/manga/HunterXHunter-v01.cbzRun more conversions in parallel (default is half your CPU threads):
kindlecc -j 8 ~/manga/HunterXHunter| Flag | Description |
|---|---|
-o, --output <DIR> |
Output directory (default: same dir as input) |
-r, --right-to-left |
Right-to-left reading (default; for manga) |
-l, --left-to-right |
Left-to-right reading (for western comics) |
-q, --quality <N> |
JPEG quality, 1–100 (default: 100) |
--no-crop |
Disable margin cropping |
--no-contrast |
Disable auto-contrast |
--no-split |
Disable double-page spread splitting |
-j, --jobs <N> |
Parallel files (default: half of CPU threads) |
--quiet |
Print only output file paths |
- Extract images from the CBZ in natural sort order.
- If a page is wider than tall, split it into two pages (LTR/RTL aware).
- Crop near-uniform white/black margins (up to 10% per edge).
- Convert to grayscale and apply an auto-contrast stretch.
- Resize to fit 1072×1448 (Kindle Paperwhite-class panel) preserving aspect.
- JPEG-encode at the chosen quality.
- Build a fixed-layout EPUB 3 with the first page tagged as the cover image.
- Run
kindlegento produce the final.mobi.
All of the design choices around panel size, fixed layout, page-spread spine ordering, etc. come from kcc. Use kcc if you want a full-featured GUI, more output formats, and active community support — kindlecc is a minimal Rust reimplementation tuned for fast, parallel batch CBZ→MOBI conversion from the command line.