From 50c0f59ce6a8548a77c517a60b41af66096dd1fd Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 24 Mar 2023 17:56:56 -0700 Subject: [PATCH] wip --- dither-image.js | 8 ++++++++ video/combine.sh | 1 + 2 files changed, 9 insertions(+) diff --git a/dither-image.js b/dither-image.js index 1c00068..1b6ca30 100644 --- a/dither-image.js +++ b/dither-image.js @@ -651,6 +651,14 @@ function decimate(input, palette, n) { rgb = rgb.multiply(brightest / avg_luma).clamp(); } + /* + // 1) take the brightest luma + // 2) take the most saturated chroma + // 3) profit! + let lumas = bucket.map((rgb) => rgb.luma()); + let luma = Math.max(...lumas); + let rgb = bucket[lumas.indexOf(luma)]; + */ // pick the luma-brightest color in the bucket // kinda nice but really aggressive with the colors diff --git a/video/combine.sh b/video/combine.sh index e56e0e5..02c75ea 100644 --- a/video/combine.sh +++ b/video/combine.sh @@ -6,4 +6,5 @@ ffmpeg \ -ar 48000 \ -vf 'pad=w=640:h=360:x=52:y=20' \ -pix_fmt yuv420p \ + -movflags +faststart \ -y colamath-dither.mp4