diff --git a/source/2022-03-06.ts b/source/2022-03-06.ts index b675f63..e0cfb48 100644 --- a/source/2022-03-06.ts +++ b/source/2022-03-06.ts @@ -11,6 +11,7 @@ import Project from './project.js'; const [width, height] = [1920, 1080]; const project: Project = { + createInputImage: false, name: '2022-03-06', operations: [ new SimplexNoise({scale: 4, seed: 2_071_140_406}), diff --git a/source/2022-03-07.ts b/source/2022-03-07.ts index cc988a5..5a9e68b 100644 --- a/source/2022-03-07.ts +++ b/source/2022-03-07.ts @@ -4,6 +4,7 @@ import Project from './project.js'; const [width, height] = [1920, 1080]; const project: Project = { + createInputImage: false, name: '2022-03-07', operations: [ new Plasma({ diff --git a/source/2022-03-08.ts b/source/2022-03-08.ts index 803ff47..a628973 100644 --- a/source/2022-03-08.ts +++ b/source/2022-03-08.ts @@ -10,6 +10,7 @@ import Project from './project.js'; const [width, height] = [1920, 1080]; const project: Project = { + createInputImage: false, name: '2022-03-08', operations: [ new Generic('gegl:diffraction-patterns', { diff --git a/source/driftingnebula.ts b/source/driftingnebula.ts index 4837eb9..cfa8949 100644 --- a/source/driftingnebula.ts +++ b/source/driftingnebula.ts @@ -18,7 +18,7 @@ async function main(): Promise { const projects: Project[] = [d2022_03_06, d2022_03_07, d2022_03_08]; - for (const {name, operations, resolution} of projects) { + for (const {createInputImage, name, operations, resolution} of projects) { const dataStart = performance.now(); const {width, height} = resolution; @@ -55,10 +55,21 @@ async function main(): Promise { if (noRender) { console.log(`* Skipped ${outputFile}`); } else { + const fullOutputFile = path.join(baseDir, outputFile); + if (createInputImage) { + await execa('magick', [ + '-size', + `${width}x${height}`, + 'xc:white', + fullOutputFile, + ]); + } + console.log(`* Writing ${outputFile}`); await execa('gegl', [ + ...(createInputImage ? ['-i', fullOutputFile] : []), '-o', - path.join(baseDir, outputFile), + fullOutputFile, '--', ...graph, ]); @@ -66,7 +77,7 @@ async function main(): Promise { console.log(`* Writing ${compressedFile}`); await execa('magick', [ 'convert', - path.join(baseDir, outputFile), + fullOutputFile, '-quality', '92', path.join(baseDir, compressedFile), diff --git a/source/project.ts b/source/project.ts index 2952f41..c21ad87 100644 --- a/source/project.ts +++ b/source/project.ts @@ -1,6 +1,7 @@ import {BaseOperation} from './gegl/exports.js'; export default interface Project { + createInputImage: boolean; name: string; operations: Array>; resolution: {