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 hashes)

Uploaded Source

Built Distribution

generate_background_image-0.0.2-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

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