Skip to main content

Comic Book Quantizer

Comic Book Quantizer (cbquant) is a command-line interface tool that converts images within comic book archive files to palette-based indexed images.

Using cbquant can result in up to 9x smaller comic book archive files, while still preserving the majority of details. This tool is ideal for generating compressed comic books or manga for viewing on grayscale e-ink devices.

Features

  • Quantization of comic book archive images to a specific number of colors, with dithering.
  • Optional, separate quantization levels for color images and grayscale images.
  • Resize images while maintaining aspect ratio.
  • Parallelized conversion for fast quantization.

Installation

From PyPi:

pip install cbquant

From Github:

pip install -e git+https://github.com/Brikwerk/cbquant

Usage

Compress a single .cbz file (called test.cbz) to 2 colors for grayscale images and 4 colours for color images:

python cbquant.py test.cbz --ncolors 2 --color_ncolors 4

Compress a directory of comic book archive files and output all compressed files to a new folder:

python cbquant.py "/path/to/files/*" --ncolors 2 --color_ncolors 4 --height 1872 --output ./quant

Acknowledgements

Thanks to libimagequant and libimagequant-python for the image quantization code used in this tool.

Metadata

Release files for cbquant 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cbquant 0.1
File Size Uploaded Provenance Actions
cbquant-0.1.tar.gz 6.2 kB Without provenance Details for cbquant-0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cbquant 0.1
File Interpreter ABI Platform Actions
cbquant-0.1-py3-none-any.whl Python 3 none any Details for cbquant-0.1-py3-none-any.whl

Total release size: 13.0 kB

Release files / cbquant-0.1.tar.gz

Download URL cbquant-0.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9f070bddec97173df03a7067c9025b0ed6594c9fdc72b9b4892c8add79c5af1e
BLAKE2b-256 checksum
How to use checksums
cf3f37786b5b251fccaaec4252d72f16228f5bef7f96b2e7c2cddd851c0e8148
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / cbquant-0.1-py3-none-any.whl

Download URL cbquant-0.1-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1be85b11c829bc09e8a69340b27ba7186c843e7742ff8b1e3c3e75e5e3216cfd
BLAKE2b-256 checksum
How to use checksums
f19e4d874fc1e3ce265e00c0090edddb79b54f36ac4787e2676e0e315fa15d65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Security for cbquant 0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page