From 5196adef43981fb47bce7d248c4b35927e0e9d34 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 25 Mar 2023 20:26:45 -0700 Subject: [PATCH] tweak --- dither-image.js | 12 ------------ video-cat/combine.sh | 2 +- video-cat/extract.sh | 2 +- video-doom/combine.sh | 2 +- video-doom/extract.sh | 2 +- video/combine.sh | 2 +- video/extract.sh | 2 +- 7 files changed, 6 insertions(+), 18 deletions(-) diff --git a/dither-image.js b/dither-image.js index 07a66da..93fddd9 100644 --- a/dither-image.js +++ b/dither-image.js @@ -589,7 +589,6 @@ function decimate(input, palette, n) { // preface the reserved bits let buckets = reserved.slice().map((c) => [atariRGB[c]]).concat([input.slice()]); if (input.length != 160) { - console.log(input.length); throw new Error('xxx bad input size'); } @@ -615,7 +614,6 @@ function decimate(input, palette, n) { }; let medianCut = (bucket, range) => { if (bucket.length < 2) { - console.log(bucket); throw new Error('short bucket'); } //console.log('medianCut', bucket, range); @@ -642,7 +640,6 @@ function decimate(input, palette, n) { // Find the bucket with the greatest range in any channel let ranges = buckets.map((bucket) => { if (bucket.length == 0) { - console.log(buckets); throw new Error('xxx empty bucket'); } let red = bucket.map((rgb) => rgb.r); @@ -766,13 +763,7 @@ function decimate(input, palette, n) { let index = dists.indexOf(closest); return palette[index]; }); - // hack decimated.sort((a, b) => a - b); - console.log(decimated); - - // we shouldn't have to do this - //decimated[0] = 0; - console.log(decimated); // Palette fits return dither(decimated); @@ -842,7 +833,6 @@ async function convert(source) { height, rgba } = await loadImage(source); - console.log({width,height}); if (width > 160) { throw new Error(`expected <160px width, got ${width} pixels`); @@ -893,9 +883,7 @@ async function convert(source) { .slice(y * width, (y + 1) * width); if (padding) { - console.log(`length was ${inputLine.length}`); inputLine = left.concat(inputLine, right); - console.log(`length is now ${inputLine.length}`); } if (y > 0) { let error = lines[y - 1].error; diff --git a/video-cat/combine.sh b/video-cat/combine.sh index e41f542..b3e81fb 100644 --- a/video-cat/combine.sh +++ b/video-cat/combine.sh @@ -4,7 +4,7 @@ ffmpeg \ -i 'cats-audio.wav' \ -ac 2 \ -ar 48000 \ - -vf 'pad=w=640:h=360:x=52:y=20' \ + -vf 'pad=w=534' \ -pix_fmt yuv420p \ -movflags +faststart \ -y cats-dither.mp4 diff --git a/video-cat/extract.sh b/video-cat/extract.sh index 9c15aa4..8675eb7 100644 --- a/video-cat/extract.sh +++ b/video-cat/extract.sh @@ -4,7 +4,7 @@ mkdir -p frames ffmpeg \ -i 'cats computer fun.mp4' \ - -vf 'scale=160:150,pad=h=160:y=5' \ + -vf 'scale=320:150,pad=h=192:y=5' \ -an \ -y 'frames/cats-%04d.png' diff --git a/video-doom/combine.sh b/video-doom/combine.sh index 9e6b03f..45e2f68 100644 --- a/video-doom/combine.sh +++ b/video-doom/combine.sh @@ -4,7 +4,7 @@ ffmpeg \ -i 'doom-audio.wav' \ -ac 2 \ -ar 48000 \ - -vf 'pad=w=640:h=360:x=52:y=20' \ + -vf 'pad=w=534' \ -pix_fmt yuv420p \ -movflags +faststart \ -y doom-dither.mp4 diff --git a/video-doom/extract.sh b/video-doom/extract.sh index b34bcea..a92ff17 100644 --- a/video-doom/extract.sh +++ b/video-doom/extract.sh @@ -8,7 +8,7 @@ ffmpeg \ -i 'doom-speedrun.webm' \ -t $TIME \ -r 60000/1001 \ - -vf 'scale=160:192' \ + -vf 'scale=320:192' \ -an \ -y 'frames/doom-%04d.png' diff --git a/video/combine.sh b/video/combine.sh index 02c75ea..38ba115 100644 --- a/video/combine.sh +++ b/video/combine.sh @@ -4,7 +4,7 @@ ffmpeg \ -i 'colamath-audio.wav' \ -ac 2 \ -ar 48000 \ - -vf 'pad=w=640:h=360:x=52:y=20' \ + -vf 'pad=w=534' \ -pix_fmt yuv420p \ -movflags +faststart \ -y colamath-dither.mp4 diff --git a/video/extract.sh b/video/extract.sh index e626e3c..4f8070a 100644 --- a/video/extract.sh +++ b/video/extract.sh @@ -4,7 +4,7 @@ mkdir -p frames ffmpeg \ -i colamath-dv.avi \ - -vf 'yadif=1,scale=160:200,crop=h=160' \ + -vf 'yadif=1,scale=320:200,crop=h=192:y=4' \ -an \ -y 'frames/colamath-%04d.png'