Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Utility for a generation of memes

Project description

Features

  • a generation of memes (in PNG format);
  • a support of plain and graphic backgrounds;
  • a specification of a text rectangle;
  • a support of horizontal and vertical text alignments;
  • a read of memes texts from a file (each text is separated from another by a double newline);
  • a support single-line and multiline memes texts;
  • a protection against duplicate memes texts;
  • a support of a watermark (it’s optional);
  • meme settings:
    • background:
      • color;
      • width;
      • height;
      • image (it supports same formats as Pillow library);
    • text:
      • font (it supports only TrueType fonts);
      • size;
      • color;
      • left;
      • rigth;
      • top;
      • bottom;
      • horizontal alignment;
      • vertical alignment;
    • watermark:
      • font (it always uses the text font);
      • text;
      • size;
      • color.

Installation

$ pip install white-generator

Usage

$ white-generator -v | --version
$ white-generator -h | --help
$ white-generator [options] (-f FONT_FILE | --font-file FONT_FILE) (-i INPUT_FILE | --input-file INPUT_FILE) (-o OUTPUT_PATH | --output-path OUTPUT_PATH)

Options:

  • -v, --version — show the version message and exit;
  • -h, --help — show this help message and exit;
  • -i INPUT_FILE, --input-file INPUT_FILE — the path to the file with notes;
  • -o OUTPUT_PATH, --output-path OUTPUT_PATH — the path for generated images;
  • -l TEXT_LEFT, --text-left TEXT_LEFT — the left text position (default: 0);
  • -t TEXT_TOP, --text-top TEXT_TOP — the top text position (default: 0);
  • -R TEXT_RIGHT, --text-right TEXT_RIGHT — the horizontal text limit (-1 for a background width use; default: -1);
  • -B TEXT_BOTTOM, --text-bottom TEXT_BOTTOM — the vertical text limit (-1 for a background height use; default: -1);
  • -a {left,center,right}, --text-horizontal-align {left,center,right} — the text horizontal alignment (default: center);
  • -A {top,center,bottom}, --text-vertical-align {top,center,bottom} — the text vertical alignment (default: center);
  • -W IMAGE_WIDTH, --image-width IMAGE_WIDTH — the image width (default: 640);
  • -H IMAGE_HEIGHT, --image-height IMAGE_HEIGHT — the image height (default: 480);
  • -b IMAGE_BACKGROUND_COLOR, --image-background-color IMAGE_BACKGROUND_COLOR — the image background color (default: #ffffff);
  • -I IMAGE_BACKGROUND_IMAGE, --image-background-image IMAGE_BACKGROUND_IMAGE — the path to the background image (default: none);
  • -f FONT_FILE, --font-file FONT_FILE — the path to the font file;
  • -s FONT_SIZE, --font-size FONT_SIZE — the font size (default: 25);
  • -c FONT_COLOR, --font-color FONT_COLOR — the font color (default: #000000);
  • -w WATERMARK_TEXT, --watermark-text WATERMARK_TEXT — the watermark text (empty for disable; default: empty);
  • -S WATERMARK_SIZE, --watermark-size WATERMARK_SIZE — the watermark font size (default: 12);
  • -C WATERMARK_COLOR, --watermark-color WATERMARK_COLOR — the watermark font color (default: #808080);
  • -d DATABASE_FILE, --database-file DATABASE_FILE — the path to the database file (default: notes.db).

Project details


Release history Release notifications

This version
History Node

1.3.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
white_generator-1.3.0-py3-none-any.whl (10.4 kB) Copy SHA256 hash SHA256 Wheel py3
white-generator-1.3.0.tar.gz (8.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page