diff --git a/source/driftingnebula.ts b/source/driftingnebula.ts index 3fc73bd..4837eb9 100644 --- a/source/driftingnebula.ts +++ b/source/driftingnebula.ts @@ -44,6 +44,7 @@ async function main(): Promise { const graphFile = `${name}.txt`; const outputFile = `${name}.png`; + const compressedFile = `${outputFile.slice(0, -4)}.jpeg`; console.log(`* Writing ${graphFile}`); await fsp.writeFile( @@ -61,6 +62,15 @@ async function main(): Promise { '--', ...graph, ]); + + console.log(`* Writing ${compressedFile}`); + await execa('magick', [ + 'convert', + path.join(baseDir, outputFile), + '-quality', + '92', + path.join(baseDir, compressedFile), + ]); } const time = (performance.now() - dataStart).toFixed(2);