Convert PDF files to CBZ (Comic Book Zip) format with ease, leveraging the power of Python. This tool provides a seamless way to transform your PDFs into CBZ archives, ideal for comic book enthusiasts and digital archivists alike.
- Convert PDF to CBZ archive.
- Option to use WebP for image compression, offering high-quality images at smaller file sizes.
- Customizable image quality settings.
- Python 3.6 or higher
- pip (Python package installer)
If you prefer using Conda, follow these steps to create a new environment and install the required dependencies:
- Create a new Conda environment:
conda create --name pdf2cbz python=3.8
- Activate the environment:
conda activate pdf2cbz
- Install the dependencies:
conda install -c conda-forge pymupdf pillow
For those who prefer Python's virtual environment, follow these steps:
- Create a virtual environment:
python3 -m venv pdf2cbz-env
- Activate the environment:
For Windows:
For Unix or MacOS:
pdf2cbz-env\Scripts\activate
source pdf2cbz-env/bin/activate
- Install the dependencies from
requirements.txt
:pip install -r requirements.txt
To convert a PDF to CBZ format, run the pdf2cbz.py
script with the following command:
python pdf2cbz.py --input <path_to_pdf> --output <path_to_cbz> --format <image_format> --quality <quality>
<path_to_pdf>
: Path to the source PDF file.<path_to_cbz>
: Path to the output CBZ file.<image_format>
: (Optional) Image format for compression. Choose between 'png' and 'webp'. Default is 'webp'.<quality>
: (Optional) Quality of the compressed images. Default is 80.
Contributions are welcome! Please feel free to submit a pull request or open an issue.