Skip to content

Brikwerk/cbquant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 the Github main branch:

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

Usage

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

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

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

cbquant "/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.

About

Lossy Comic Book Archive Compressor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages