Skip to main content

Python utility for generating cover images for e-books.

Project description

CoverGenerator

CoverGenerator is a utility for generating simple book covers containing the book title nd author. The covers are generated using SVG and then rendered to an image file. This project is heavily inspired by racovimge and uses basically the same methods for creating covers, but this project has better multiline support and doesn't rely on any non-python applications for image exporting.

NOTE: Due to limitations with CairoSVG, CoverGenerator can't use embedded fonts and has to instead use system fonts. For proper word spacing and formatting, NotoSerif Bold & Bold Italic must be installed on your system. The program will still work without it, but you might have some odd word wrapping.

Installation

CoverGenerator can be downloaded from it's PyPI package using pip:

pip3 install CoverGenerator

If you are installing from source, the following python packages are required:

Command Line Script

You can generate a random cover with:

cover-generator -t "Title Text" -a "Author(s)"

You can specify the filename and image format with the --output tag, and set the width in pixels with the --width tag:

cover-generator -t "JPEG Cover" -a Writer -o coverimage.jpg -w 900

You can also specify a specific cover style and/or color palette using the --style and --palette tags:

cover-generator -t Title -a Author -s border -p ColorfulContrast

Available cover styles and color palettes are listed alongside options when using the --help command

Basic Python Usage

import cover_generator

# Create a random cover image
cover_generator.generate_cover(title="Title", author="author", path="/path/to/file.jpg")

# Create a random cover image with a specific cover style and color palette
cover_generator.generate_cover(title="Title", author="author", path="/path/to/file.jpg",
        cover_style="cross" palette_category="ColorfulContrast")

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

CoverGenerator-0.2.0-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file CoverGenerator-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for CoverGenerator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd88af114b8f796b51e09fbb74bcba64fcbcfd700060883bc103bee76e0c6782
MD5 cc427da7dabc5fc67936c79529cc727f
BLAKE2b-256 ae1bf5797e6076a9ddfb868b8ac56a2ad013b2475fb33c20db7c680b33ae3193

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