cleaner handling of reserved colors

This commit is contained in:
Brooke Vibber 2023-03-24 12:52:22 -07:00
parent 363cf21ba5
commit 37b06789b0
2 changed files with 6 additions and 2 deletions

View file

@ -580,7 +580,11 @@ function decimate(input, palette, n) {
// Median cut! // Median cut!
// https://en.wikipedia.org/wiki/Median_cut // https://en.wikipedia.org/wiki/Median_cut
let buckets = [input.slice()]; //let buckets = [input.slice()];
// preface the reserved bits
let buckets = reserved.slice().map((c) => [atariRGB[c]]).concat([input.slice()]);
let medianCut = (bucket, range) => { let medianCut = (bucket, range) => {
if (bucket.length < 2) { if (bucket.length < 2) {
console.log(bucket); console.log(bucket);

View file

@ -4,6 +4,6 @@ ffmpeg \
-i 'colamath-audio.wav' \ -i 'colamath-audio.wav' \
-ac 2 \ -ac 2 \
-ar 48000 \ -ar 48000 \
-vf 'pad=w=640:h=480:x=52:y=80' \ -vf 'pad=w=640:h=360:x=52:y=20' \
-pix_fmt yuv420p \ -pix_fmt yuv420p \
-y colamath-dither.mp4 -y colamath-dither.mp4