Add a way to generate a blank input image.
This commit is contained in:
parent
8efa0898bf
commit
69d0246301
|
@ -11,6 +11,7 @@ import Project from './project.js';
|
||||||
const [width, height] = [1920, 1080];
|
const [width, height] = [1920, 1080];
|
||||||
|
|
||||||
const project: Project = {
|
const project: Project = {
|
||||||
|
createInputImage: false,
|
||||||
name: '2022-03-06',
|
name: '2022-03-06',
|
||||||
operations: [
|
operations: [
|
||||||
new SimplexNoise({scale: 4, seed: 2_071_140_406}),
|
new SimplexNoise({scale: 4, seed: 2_071_140_406}),
|
||||||
|
|
|
@ -4,6 +4,7 @@ import Project from './project.js';
|
||||||
const [width, height] = [1920, 1080];
|
const [width, height] = [1920, 1080];
|
||||||
|
|
||||||
const project: Project = {
|
const project: Project = {
|
||||||
|
createInputImage: false,
|
||||||
name: '2022-03-07',
|
name: '2022-03-07',
|
||||||
operations: [
|
operations: [
|
||||||
new Plasma({
|
new Plasma({
|
||||||
|
|
|
@ -10,6 +10,7 @@ import Project from './project.js';
|
||||||
const [width, height] = [1920, 1080];
|
const [width, height] = [1920, 1080];
|
||||||
|
|
||||||
const project: Project = {
|
const project: Project = {
|
||||||
|
createInputImage: false,
|
||||||
name: '2022-03-08',
|
name: '2022-03-08',
|
||||||
operations: [
|
operations: [
|
||||||
new Generic('gegl:diffraction-patterns', {
|
new Generic('gegl:diffraction-patterns', {
|
||||||
|
|
|
@ -18,7 +18,7 @@ async function main(): Promise<void> {
|
||||||
|
|
||||||
const projects: Project[] = [d2022_03_06, d2022_03_07, d2022_03_08];
|
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 dataStart = performance.now();
|
||||||
const {width, height} = resolution;
|
const {width, height} = resolution;
|
||||||
|
|
||||||
|
@ -55,10 +55,21 @@ async function main(): Promise<void> {
|
||||||
if (noRender) {
|
if (noRender) {
|
||||||
console.log(`* Skipped ${outputFile}`);
|
console.log(`* Skipped ${outputFile}`);
|
||||||
} else {
|
} else {
|
||||||
|
const fullOutputFile = path.join(baseDir, outputFile);
|
||||||
|
if (createInputImage) {
|
||||||
|
await execa('magick', [
|
||||||
|
'-size',
|
||||||
|
`${width}x${height}`,
|
||||||
|
'xc:white',
|
||||||
|
fullOutputFile,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`* Writing ${outputFile}`);
|
console.log(`* Writing ${outputFile}`);
|
||||||
await execa('gegl', [
|
await execa('gegl', [
|
||||||
|
...(createInputImage ? ['-i', fullOutputFile] : []),
|
||||||
'-o',
|
'-o',
|
||||||
path.join(baseDir, outputFile),
|
fullOutputFile,
|
||||||
'--',
|
'--',
|
||||||
...graph,
|
...graph,
|
||||||
]);
|
]);
|
||||||
|
@ -66,7 +77,7 @@ async function main(): Promise<void> {
|
||||||
console.log(`* Writing ${compressedFile}`);
|
console.log(`* Writing ${compressedFile}`);
|
||||||
await execa('magick', [
|
await execa('magick', [
|
||||||
'convert',
|
'convert',
|
||||||
path.join(baseDir, outputFile),
|
fullOutputFile,
|
||||||
'-quality',
|
'-quality',
|
||||||
'92',
|
'92',
|
||||||
path.join(baseDir, compressedFile),
|
path.join(baseDir, compressedFile),
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import {BaseOperation} from './gegl/exports.js';
|
import {BaseOperation} from './gegl/exports.js';
|
||||||
|
|
||||||
export default interface Project {
|
export default interface Project {
|
||||||
|
createInputImage: boolean;
|
||||||
name: string;
|
name: string;
|
||||||
operations: Array<InstanceType<typeof BaseOperation>>;
|
operations: Array<InstanceType<typeof BaseOperation>>;
|
||||||
resolution: {
|
resolution: {
|
||||||
|
|
Loading…
Reference in New Issue