GitXplorerGitXplorer
a

happybackgrounds

public
7 stars
0 forks
0 issues

Commits

List of commits on branch joy.
Unverified
73f404d5f13c884952d455bc4356b1f2cd7cbcd5

Add a parameter for setting the maximum rotation

aalexwlchan committed 4 years ago
Unverified
e4dcb98d894abe3e9b5ac35d0c0c92d622628e05

Tweak the positioning algorithm to draw on a fixed grid

aalexwlchan committed 4 years ago
Unverified
208dd26f479f6f8594711dca919518fea3e45c87

Use British spelling

aalexwlchan committed 4 years ago
Unverified
4cf8676183c71d837a1cc734221235284e4bf73e

Add a flag for avoiding the center of the screen

aalexwlchan committed 4 years ago
Unverified
cf252ed37ccbf4a33cdcd40c155ac3eef7c6327e

Don't forget the alt text!

aalexwlchan committed 4 years ago
Unverified
ff44e751656e9a9e0887ce5da598b27a6ad5d3e5

Use Kate's choice of command prompt in the examples

aalexwlchan committed 4 years ago

README

The README file for this repository.

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.