Skip to main content

Lossy Comic Book Archive Compressor

Project description

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.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cbquant-0.1.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

cbquant-0.1-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page