diff options
author | davidovski <david@davidovski.xyz> | 2023-07-21 11:05:15 +0200 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-08-09 02:42:03 +0100 |
commit | f298c481fd08b58a26e17b1c36ced8128440dbf7 (patch) | |
tree | 322bb1788fdf4c4f6a5c43fc33200c5cb7647810 /site/images | |
parent | 9ac6c99826fc6a4deacd1fb2ead47920cf66cdcd (diff) |
move non-executables to site subdir
Diffstat (limited to 'site/images')
-rwxr-xr-x | site/images/bg.gif | 2 | ||||
-rw-r--r-- | site/images/bg.png | bin | 0 -> 2416724 bytes | |||
-rwxr-xr-x | site/images/gif.py | 70 | ||||
-rw-r--r-- | site/images/remotecontrol-small.png | bin | 0 -> 15993 bytes | |||
-rwxr-xr-x | site/images/remotecontrol.gif | 2 | ||||
-rw-r--r-- | site/images/remotecontrol.png | bin | 0 -> 18514 bytes |
6 files changed, 74 insertions, 0 deletions
diff --git a/site/images/bg.gif b/site/images/bg.gif new file mode 100755 index 0000000..044324f --- /dev/null +++ b/site/images/bg.gif @@ -0,0 +1,2 @@ +#!/bin/sh +./gif.py diff --git a/site/images/bg.png b/site/images/bg.png Binary files differnew file mode 100644 index 0000000..d08f9ed --- /dev/null +++ b/site/images/bg.png diff --git a/site/images/gif.py b/site/images/gif.py new file mode 100755 index 0000000..26e8408 --- /dev/null +++ b/site/images/gif.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +import glob +import sys +import os +import math +import random +from PIL import Image + + +def color(hex_value): + h = hex_value.lstrip('#') + while len(h) < 8: + h += "f" + return tuple(int(h[i:i+2], 16) for i in (0, 2, 4, 6)) + +def rgb_to_v(c): + r, g, b = c[0]/255.0, c[1]/255.0, c[2]/255.0 + mx = max(r, g, b) + v = mx*100 + return v + +replace = color("#f58f44") +colors = [ + color("#191919"), + color("#373b41"), + ] + +def make(colors, inp=None): + p = len(colors) + w = int(128 / p) * p + h = int(128 / p) * p + + frames = [] + + for i in range(int(p*1*math.pi)): + if inp is None: + image = Image.new("RGBA", (w, h), colors[0]) + else: + image = Image.open(inp).convert("RGBA") + + for x in range(image.width): + for y in range(image.height): + f = 2 + r = random.randint(-f, f) + z = (i) - (y/(p/4)) + r + v = math.floor( (math.sin(z) + 1) * len(colors) * 0.5) + c = colors[v] + if inp is not None: + existing = image.getpixel((x, y)) + if existing[:3] == replace[:3]: + image.putpixel((x,y), c) + else: + image.putpixel((x,y), c) + + frames.append(image.convert("P")) + + + frames[0].save(sys.stdout, mode="P", format="GIF", append_images=frames[1:], save_all=True, duration=100, loop=0) + + +template = None +if len(sys.argv) > 1 and os.path.exists(sys.argv[1]): + template = sys.argv[1] + colors = colors + [ color("#f58f44") ] + +sorted(colors, key=rgb_to_v) +make(colors, inp=template) +#make("dist/images/remotecontrol.gif", colors2, inp="images/remotecontrol-small.png") + + diff --git a/site/images/remotecontrol-small.png b/site/images/remotecontrol-small.png Binary files differnew file mode 100644 index 0000000..fc293d0 --- /dev/null +++ b/site/images/remotecontrol-small.png diff --git a/site/images/remotecontrol.gif b/site/images/remotecontrol.gif new file mode 100755 index 0000000..5e73b92 --- /dev/null +++ b/site/images/remotecontrol.gif @@ -0,0 +1,2 @@ +#!/bin/sh +./gif.py remotecontrol-small.png diff --git a/site/images/remotecontrol.png b/site/images/remotecontrol.png Binary files differnew file mode 100644 index 0000000..62d6473 --- /dev/null +++ b/site/images/remotecontrol.png |