Also output a compressed JPEG.
This commit is contained in:
parent
693b44aeef
commit
3f6b351d23
|
@ -44,6 +44,7 @@ async function main(): Promise<void> {
|
||||||
|
|
||||||
const graphFile = `${name}.txt`;
|
const graphFile = `${name}.txt`;
|
||||||
const outputFile = `${name}.png`;
|
const outputFile = `${name}.png`;
|
||||||
|
const compressedFile = `${outputFile.slice(0, -4)}.jpeg`;
|
||||||
|
|
||||||
console.log(`* Writing ${graphFile}`);
|
console.log(`* Writing ${graphFile}`);
|
||||||
await fsp.writeFile(
|
await fsp.writeFile(
|
||||||
|
@ -61,6 +62,15 @@ async function main(): Promise<void> {
|
||||||
'--',
|
'--',
|
||||||
...graph,
|
...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);
|
const time = (performance.now() - dataStart).toFixed(2);
|
||||||
|
|
Loading…
Reference in New Issue