diff options
| author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-11 00:46:06 +0200 |
|---|---|---|
| committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-11 00:46:06 +0200 |
| commit | 95f87b6fec2f1fbccfce86b911ca05b7284ec439 (patch) | |
| tree | 2e38e9fa047cdc35df41eaf3a814693bcee0c067 | |
| parent | cb0908c919eadb52a2426c887c37b5c64447d82f (diff) | |
| download | usermoji-95f87b6fec2f1fbccfce86b911ca05b7284ec439.tar.xz | |
add disco
| -rw-r--r-- | Makefile | 11 | ||||
| -rw-r--r-- | discooverlay.mkv | bin | 0 -> 3895 bytes | |||
| -rwxr-xr-x | mkdisco | 2 | ||||
| -rwxr-xr-x | mkdiscooverlay | 26 |
4 files changed, 37 insertions, 2 deletions
@@ -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 Binary files differnew file mode 100644 index 00000000..5c85b883 --- /dev/null +++ b/discooverlay.mkv 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() |
