diff --git a/README.md b/README.md index 2870989..7dce2a5 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,13 @@ ![Logo](./images/logo.png) -**huepaper** creates wallpapers based on color hues. Bring a little -color in your life by randomness, because every huepaper is truly -unique. +**huepaper** creates colorful wallpapers, using the [HSL color +space](https://en.wikipedia.org/wiki/HSL_and_HSV). It is based on +[**colour**](https://github.com/vaab/colour) and +[**pillow**](https://python-pillow.org/). + +Every *huepaper* is randomly generated and therefore truly unique. Let +randomness bring a little color in your life. You can find [examples](#examples) below. @@ -33,18 +37,18 @@ Install the python requirements with `pip install -r requirements.txt`. optional arguments: -h, --help show this help message and exit -W WIDTH, --width WIDTH - width of wallpaper (defaul: 1920) + width of huepaper (default: 1920) -H HEIGHT, --height HEIGHT - height of wallpaper (default: 1080) + height of huepaper (default: 1080) -c COLOR, --color COLOR - color, the wallpaper is generated from (uses a random + color, the huepaper is generated from (uses a random color if not given) - -p, --preview preview wallpaper + -p, --preview preview huepaper -o OUTPUT, --output OUTPUT - file where to save the wallpaper to (default: None) + file where to save the huepaper to (default: None) -l [LINES], --lines [LINES] include one to three random lines in base color with - given opacity in range [0, 1] (default: 0.1) + given opacity in range [0, 1] (default: 0.3) -lb [LINES_BRIGHT], --lines_bright [LINES_BRIGHT] include one to three bright random lines with given opacity in range [0, 1] (default: 0.1) @@ -54,7 +58,7 @@ Install the python requirements with `pip install -r requirements.txt`. -P PIXELATE, --pixelate PIXELATE pixelate image (e.g. 42x42) -e EMBLEM, --emblem EMBLEM - emblem to add in the center of the wallpaper + emblem to add in the center of the huepaper -hue HUE maximum hue to differ from given color in range [0, 1] (default: 0.1) -smin SMIN minimum satisfaction for colors in range [0, 1] diff --git a/huepaper.py b/huepaper.py index efc270e..c3152c7 100755 --- a/huepaper.py +++ b/huepaper.py @@ -8,6 +8,21 @@ from colour import Color from PIL import Image, ImageDraw, ImageOps +def print_logo(): + logo = ''' + .lk. + cO. + cO.;:lc. ,c. .cc .,',c; .,c.;coc. ;,.,c. ':l.:lo: '',:c. '::.lo. + cO' kd .O; dO ,x...,Ox cO; lO: ;x xk OO. .kO. x;...x0' 0x. . + cO. xx .O; dO ko...... :O. Ox .,..xO kk ;0;;0...... 0d + cO. xx .O; xO dO. .. :O. .O; dk xO kk :O.'0o , 0d + .dk, .kk. okc;,ox' ckxllc. :Oc'.,l' oOl;'dO:. kO;..:l. ,xOolc; ,Ox. + :O. kk + lO, OO + OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO00O0000000000000000; +'''; + print(logo) + # Get base color def get_base_color(color_string = None): @@ -189,16 +204,16 @@ def main(): # Initialize parser parser = argparse.ArgumentParser(description = 'Create wallpapers based on color hues.') - parser.add_argument('-W', '--width', default = 1920, type = int, help = 'width of wallpaper (defaul: 1920)') - parser.add_argument('-H', '--height', default = 1080, type = int, help = 'height of wallpaper (default: 1080)') - parser.add_argument('-c', '--color', help = 'color, the wallpaper is generated from (uses a random color if not given)') - parser.add_argument('-p', '--preview', action = 'store_true', help = 'preview wallpaper') - parser.add_argument('-o', '--output', help = 'file where to save the wallpaper to (default: None)') - parser.add_argument('-l', '--lines', nargs = '?', const = 0.1, type = float, help = 'include one to three random lines in base color with given opacity in range [0, 1] (default: 0.1)') + parser.add_argument('-W', '--width', default = 1920, type = int, help = 'width of huepaper (default: 1920)') + parser.add_argument('-H', '--height', default = 1080, type = int, help = 'height of huepaper (default: 1080)') + parser.add_argument('-c', '--color', help = 'color, the huepaper is generated from (uses a random color if not given)') + parser.add_argument('-p', '--preview', action = 'store_true', help = 'preview huepaper') + parser.add_argument('-o', '--output', help = 'file where to save the huepaper to (default: None)') + parser.add_argument('-l', '--lines', nargs = '?', const = 0.3, type = float, help = 'include one to three random lines in base color with given opacity in range [0, 1] (default: 0.3)') parser.add_argument('-lb', '--lines_bright', nargs = '?', const = 0.1, type = float, help = 'include one to three bright random lines with given opacity in range [0, 1] (default: 0.1)') parser.add_argument('-ld', '--lines_dark', nargs = '?', const = 0.1, type = float, help = 'include one to three dark random lines with given opacity in range [0, 1] (default: 0.1)') parser.add_argument('-P', '--pixelate', help = "pixelate image (e.g. 42x42)") - parser.add_argument('-e', '--emblem', help = 'emblem to add in the center of the wallpaper') + parser.add_argument('-e', '--emblem', help = 'emblem to add in the center of the huepaper') parser.add_argument('-hue', default = 0.1, type = float, help = 'maximum hue to differ from given color in range [0, 1] (default: 0.1)') parser.add_argument('-smin', default = 0.2, type = float, help = 'minimum satisfaction for colors in range [0, 1] (default: 0.2)') parser.add_argument('-smax', default = 1.0, type = float, help = 'maximum satisfaction for colors in range [0, 1] (default: 1.0)') @@ -235,6 +250,7 @@ def main(): parser.error('Pixelation value must be set in form: 42x42') # Main routine + print_logo() base_color = get_base_color(color) c1, c2, c3, c4 = create_colors(base_color) image = create_base_image(c1, c2, c3, c4) @@ -252,6 +268,8 @@ def main(): if emblem: image = add_emblem(image, emblem) + image.mode = 'RGB' + if preview: image.show() if not output: diff --git a/images/logo.png b/images/logo.png index 27def61..3f72832 100644 Binary files a/images/logo.png and b/images/logo.png differ diff --git a/images/logo.svg b/images/logo.svg index da9428b..362aa0c 100644 --- a/images/logo.svg +++ b/images/logo.svg @@ -11,8 +11,8 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="1000" - height="212.5" - viewBox="0 0 264.58333 56.22396" + height="274.914" + viewBox="0 0 264.58333 72.737665" version="1.1" id="svg8" inkscape:version="0.92.4 (5da689c313, 2019-01-14)" @@ -26,33 +26,24 @@ inkscape:collect="always" id="linearGradient825-7"> - + x2="200.93031" + y2="263.02499" /> + units="mm" /> @@ -89,27 +80,11 @@ inkscape:label="Ebene 1" inkscape:groupmode="layer" id="layer1" - transform="translate(0,-240.77602)"> - huepaper - + transform="translate(0,-224.26232)"> +