cleaner handling of reserved colors
This commit is contained in:
parent
363cf21ba5
commit
37b06789b0
2 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue