aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2026-04-11 00:46:06 +0200
committerLizzy Fleckenstein <lizzy@vlhl.dev>2026-04-11 00:46:06 +0200
commit95f87b6fec2f1fbccfce86b911ca05b7284ec439 (patch)
tree2e38e9fa047cdc35df41eaf3a814693bcee0c067
parentcb0908c919eadb52a2426c887c37b5c64447d82f (diff)
downloadusermoji-95f87b6fec2f1fbccfce86b911ca05b7284ec439.tar.xz
add disco
-rw-r--r--Makefile11
-rw-r--r--discooverlay.mkvbin0 -> 3895 bytes
-rwxr-xr-xmkdisco2
-rwxr-xr-xmkdiscooverlay26
4 files changed, 37 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 0fc4fc1d..ad36b549 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
USERS != ls plain | xargs basename -s .png
-all: plain cube thoughts pets ball heart
+all: plain cube thoughts pets ball heart disco
out/plain/%.png: plain/%.png | out/plain/
cp $< $@
@@ -20,18 +20,25 @@ out/ball/%ball.png: plain/%.png tools/spherize | out/ball/
out/heart/%heart.png: plain/%.png ./mkheart | out/heart/
./mkheart $< $@
+out/disco/%disco.gif: plain/%.png ./mkdisco discooverlay.mkv | out/disco/
+ ./mkdisco $< $@
+
out/%/:
mkdir -p $@
+discooverlay.mkv: mkdiscooverlay
+ ./mkdiscooverlay
+
plain: $(patsubst %, out/plain/%.png, $(USERS))
cube: $(patsubst %, out/cube/%cube.gif, $(USERS))
pets: $(patsubst %, out/pets/%pets.gif, $(USERS))
thoughts: $(patsubst %, out/thoughts/%thoughts.png, $(USERS))
ball: $(patsubst %, out/ball/%ball.png, $(USERS))
heart: $(patsubst %, out/heart/%heart.png, $(USERS))
+disco: $(patsubst %, out/disco/%disco.gif, $(USERS))
clean:
rm -rf out
-.PHONY: all plain cube thoughts pets ball heart
+.PHONY: all plain cube thoughts pets ball heart disco
.NOTPARALLEL: cube
diff --git a/discooverlay.mkv b/discooverlay.mkv
new file mode 100644
index 00000000..5c85b883
--- /dev/null
+++ b/discooverlay.mkv
Binary files differ
diff --git a/mkdisco b/mkdisco
new file mode 100755
index 00000000..74640000
--- /dev/null
+++ b/mkdisco
@@ -0,0 +1,2 @@
+#!/bin/sh
+ffmpeg -hide_banner -loglevel error -i "$1" -i discooverlay.mkv -filter_complex "[0]scale=150:150[in0];[1]format=yuva444p,colorchannelmixer=aa=0.2[in2];[in2][in0]scale2ref[in2][in1];[in1][in2]overlay" -y "$2"
diff --git a/mkdiscooverlay b/mkdiscooverlay
new file mode 100755
index 00000000..920536b3
--- /dev/null
+++ b/mkdiscooverlay
@@ -0,0 +1,26 @@
+#!/usr/bin/env lua
+function hue2rgb(hue)
+ local h = hue * 6
+ local x = math.floor((1.0 - math.abs(h % 2.0 - 1.0)) * 255)
+ return table.unpack(({
+ {255, x, 0},
+ {x, 255, 0},
+ {0, 255, x},
+ {0, x, 255},
+ {x, 0, 255},
+ {255, 0, x},
+ })[math.floor(h)+1])
+end
+
+local fps = 25
+local dur = 2
+local out = "discooverlay.mkv"
+local encoder = io.popen("ffmpeg -f rawvideo -pixel_format rgb24 -video_size 1x1 -framerate "..fps.." -i - -y "..out, "w")
+
+local total = fps*dur
+
+for i = 0, total-1 do
+ encoder:write(string.char(hue2rgb(i/total)))
+end
+
+encoder:close()