Skip to content

alexwlchan/happybackgrounds

joy
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

happybackgrounds

This is a script for generating simple wallpapers and backgrounds by splattering icons from Font Awesome over a solid block of colour. Some examples:

A grey background with dark grey crescents. A dark purple background with lighter purple five-pointed stars moving across the sky.
A light-blue background with some large turquoise-ish snowflakes. A green background with lots of small, green seedlings. Each seedling has two leaves.
A Mars-type reddish orange background, with rockets in varying levels of darkness set against the background. A yellow background with a light yellow smiling face at a jaunty angle.

Usage

You need Python 3 installed. Clone the repo, and run the "happybackgrounds" script to see how it can be used:

; git clone https://github.com/alexwlchan/happybackgrounds.git
; cd happybackgrounds
; python3 happybackgrounds.py --help

You can choose:

  • the background colour
  • the icon to use
  • how many icons to show, and how big/small to make them

The script run.sh has the invocations that generated the examples in the table above.

The script returns the path to the generated SVG file, or you can specify the output file with the --out_path flag. For example:

; python3 happybackgrounds.py --background="#d6fcff" --icon_name="snowflake"
/var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/tmpfo3v6nqr.svg

You can convert these SVGs to PNGs using ImageMagick (as was done for the table above).

Known limitations

Right now I run the script repeatedly until I get a "nice-looking" result; the success rate is nowhere near good enough to drop this into an automated process.

  • The script isn't very smart about where it places icons. Sometimes they overlap, sometimes they disappear outside the viewbox.

    Better awareness of where icons are, and spacing them nicely, would improve the success rate dramatically. This also seems hard, so I skipped doing that for the initial attempt.

  • The choice of colours is sometimes good, sometimes not-so-good. It's hard to know how to pick "good" colours. Sometimes a lot of variety is good (e.g. with the Mars rockets), other times having them close together is better (e.g. the stars).

License

CC0.

About

Create simple wallpapers and backgrounds based on Font Awesome icons. For @katef

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published