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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file cbquant-0.1.tar.gz.

File metadata

  • Download URL: cbquant-0.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for cbquant-0.1.tar.gz
Algorithm Hash digest
SHA256 9f070bddec97173df03a7067c9025b0ed6594c9fdc72b9b4892c8add79c5af1e
MD5 d3844084819792e3a89c3be63db9c6e5
BLAKE2b-256 cf3f37786b5b251fccaaec4252d72f16228f5bef7f96b2e7c2cddd851c0e8148

See more details on using hashes here.

File details

Details for the file cbquant-0.1-py3-none-any.whl.

File metadata

  • Download URL: cbquant-0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for cbquant-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1be85b11c829bc09e8a69340b27ba7186c843e7742ff8b1e3c3e75e5e3216cfd
MD5 0a61467a4d92c75a3db61305a6ec5e7c
BLAKE2b-256 f19e4d874fc1e3ce265e00c0090edddb79b54f36ac4787e2676e0e315fa15d65

See more details on using hashes here.

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