1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 17:56:30 +00:00

KCC

KCC (a.k.a. KindleComicConverter) is a Python app to convert comic files or folders to ePub or Panel View Mobipocket.
It was initally developed for Kindle but as of version 2.2 it outputs valid ePub 2.0 so despite its name, KCC is actually a comic 2 epub converter that every ereader owner can happily use.
It also optimizes comic images by:

  • enhancing contrast
  • cutting page numbering
  • cropping white borders
  • resizing larger images to device's native resolution
  • quantizing images to device's palette

BINARY RELEASES

You can find the latest released binary at the following links:

INPUT FORMATS

kcc can understand and convert, at the moment, the following file types:

  • CBZ, ZIP
  • CBR, RAR (with unrar executable)
  • folders
  • PDF (extracting only contained JPG images)

For now the script does not understand folder depth, so it will work on flat folders/archives only. As of v. 1.50, KCC supports subfolders!

OPTIONAL REQUIREMENTS

  • kindlegen in /usr/local/bin/ (for .mobi generation)
  • unrar (for CBR support)

for compiling/running from source:

  • Python 2.7+ (included in MacOS and Linux, follow the official documentation to install on Windows)
  • Pillow for comic optimizations like split double pages, resize to optimal resolution, improve contrast and palette, etc. Please refer to official documentation for installing into your system.

USAGE

GUI

Should be pretty self-explanatory, just keep in mind that it's still in development ;) While working it seems frozen, I'll try to fix the aesthetics later. Conversion being done, you should find an .epub and a .mobi files alongside the original input file (same directory)

Standalone comic2ebook.py usage:

comic2ebook.py [options] comic_file|comic_folder
  Options:
    --version             show program's version number and exit
    -h, --help            show this help message and exit
    -p PROFILE, --profile=PROFILE
                          Device profile (choose one among K1, K2, K3, K4, KDX,
                          KDXG or KHD) [default=KHD]
    -t TITLE, --title=TITLE
                          Comic title [default=filename]
    -m, --manga-style     'Manga style' (right-to-left reading and splitting)
                          [default=False]
    -v, --verbose         Verbose output [default=False]
    --no-image-processing
                          Do not apply image preprocessing (page splitting and
                          optimizations) [default=True]
    --upscale-images      Resize images smaller than device's resolution
                          [default=False]
    --stretch-images      Stretch images to device's resolution [default=False]
    --black-borders       Use black borders (instead of white ones) when not
                          stretching and ratio is not like the device's one
                          [default=False]
    --no-cut-page-numbers
                          Do not try to cut page numbering on images  
                          [default=True]
    --rotate              Disable page spliting. Instead rotate images  
                          [default=False]
    -o OUTPUT, --output=OUTPUT  
                          Output directory or file for generated ePub

The script takes care of creating an .epub from your archive/folder, then:

  1. Run Kindlegen on the generated .epub. Depending on how many images you have, this may take awhile. Once completed, the .mobi file should be in the directory.
  2. (optionally) remove the SRCS record to reduce the .mobi filesize in half. You can use Kindlestrip.
  3. Copy the .mobi file to your Kindle!

CREDITS

KCC is made by Ciro Mattia Gonano and Paweł Jastrzębski

This script born as a cross-platform alternative to KindleComicParser by Dc5e (published in this mobileread forum thread)

The app relies and includes the following scripts/binaries:

Also, for .mobi generation you need to have kindlegen v2.7+ (with KF8 support) which is downloadable from Amazon website and installed in a directory reachable by your PATH (e.g. /usr/local/bin/ or C:\Windows\)

CHANGELOG

  • 1.00: Initial version
  • 1.10: Added support for CBZ/CBR files in comic2ebook.py
  • 1.11: Added support for CBZ/CBR files in KindleComicConverter
  • 1.20: Comic optimizations! Split pages not target-oriented (landscape with portrait target or portrait with landscape target), add palette and other image optimizations from Mangle.
    WARNING: PIL is required for all image mangling!
  • 1.30: Fixed an issue in OPF generation for device resolution
    Reworked options system (call with -h option to get the inline help)
  • 1.40: Added some options for controlling image optimization
    Further optimization (ImageOps, page numbering cut, autocontrast)
  • 1.41: Fixed a serious bug on resizing when img ratio was bigger than device one
  • 1.50: Added subfolder support for multiple chapters.
  • 2.0: GUI! AppleScript is gone and Tk is used to provide cross-platform GUI support.
  • 2.1: Added basic error reporting
  • 2.2: Added (valid!) ePub 2.0 output
    Rename .zip files to .cbz to avoid overwriting
  • 2.3: Fixed win32 ePub generation, folder handling, filenames with spaces and subfolders
  • 2.4: Use temporary directory as workdir (fixes converting from external volumes and zipfiles renaming)
    Fixed "add folders" from GUI.
  • 2.5: Added --black-borders option to set added borders black when page's ratio is not the device's one (#11).
    Fixes epub containing zipped itself (#10).
  • 2.6: Added --rotate option to rotate landscape images instead of splitting them.
    Added --output option to customize ePub output dir/file.
    Add rendition:layout and rendition:orientation ePub meta tags (supported by new kindlegen 2.8)

Copyright (c) 2012-2013 Ciro Mattia Gonano with further contributions by Paweł Jastrzębski.
KCC is released under ISC LICENSE; see LICENSE.txt for further details.

Description
No description provided
Readme 66 MiB
Languages
Python 99.6%
Dockerfile 0.3%