Skip to main content

Generate a background image of words in a given string using the wordcloud module.

Project description

Generate background image

This repo is about how to Generate a background image of words in a given string using the wordcloud module. A generated background image can be used in Git repos, blogs, or articles.

Getting Started

Installation

pip3 install generate-background-image

Usage

  • To generate image with black background.
from generate_background_image import generate_background_image

word_string = "Iron man,Thanos,Doctor Strange,Captain Marvel,Hulk,Vision,Thor,Groot,Rocket,Winter Soldier,Hela,Spiderman,Black Panther,Ultron,Wanda,Gamora,Star Lord,War Machine,Silver Quick,Mantis,Captain America,Loki,Antman,Black Widow,Hawkeye,Falcon,Drax,Shuri"

generate_background_image(words=word_string, out="output_image.png", layout_color="black")

mcu_black

  • To generate image with white background.
from generate_background_image import generate_background_image

word_string = "Iron man,Thanos,Doctor Strange,Captain Marvel,Hulk,Vision,Thor,Groot,Rocket,Winter Soldier,Hela,Spiderman,Black Panther,Ultron,Wanda,Gamora,Star Lord,War Machine,Silver Quick,Mantis,Captain America,Loki,Antman,Black Widow,Hawkeye,Falcon,Drax,Shuri"

generate_background_image(words=word_string, out="output_image.png", layout_color="white")

mcu_white

Command line arguments

tag (* = required) variable options default value
-ws * word_string string of words separated by comma REQUIRED
-o * out path to output image "output_image.png"
-l layout_color choices=["black", "white"] "black"
-W width width of image 1200
-H height height of image 800
-s step_size difference between freqencies of words 50
-b bias lowest initial frequency of a word 10

LICENSE

This project is licensed under the terms of the MIT license.

Follow me

Project details


Download files

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

Source Distribution

generate_background_image-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file generate_background_image-0.0.2.tar.gz.

File metadata

  • Download URL: generate_background_image-0.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.24.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.49.0 importlib-metadata/4.11.2 keyring/21.4.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.7.4

File hashes

Hashes for generate_background_image-0.0.2.tar.gz
Algorithm Hash digest
SHA256 75216fe11ac972ea41853d83b7c3af5770f0e757fc927ae16173472876c7f886
MD5 3af6df3bbe5f9c730a6ba0e7c6a5c5c9
BLAKE2b-256 e81721cf2ddab4b632a12efdf980166f039e399cc332afafee3d39d8399cf810

See more details on using hashes here.

File details

Details for the file generate_background_image-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: generate_background_image-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.24.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.49.0 importlib-metadata/4.11.2 keyring/21.4.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.7.4

File hashes

Hashes for generate_background_image-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61d41d1abf6e5a2922213f6f8af387683ef5a38dc3bb913a2f229832d2c7ceee
MD5 db8af941cd9a08b42c8fc27b3a72aeed
BLAKE2b-256 4f347a2489c55b79c14c3c74508ef9c106cb02bf94a97794acf5f7b5165d8c0b

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