Add a way to make transparent PNGs opaque.
This commit is contained in:
parent
69d0246301
commit
3efcff153f
|
@ -56,6 +56,7 @@ const project: Project = {
|
||||||
midpoint: 0.6,
|
midpoint: 0.6,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
resetAlpha: false,
|
||||||
resolution: {
|
resolution: {
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
|
|
@ -51,6 +51,7 @@ const project: Project = {
|
||||||
}),
|
}),
|
||||||
new Generic('gegl:median-blur'),
|
new Generic('gegl:median-blur'),
|
||||||
],
|
],
|
||||||
|
resetAlpha: false,
|
||||||
resolution: {
|
resolution: {
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
|
|
@ -33,6 +33,7 @@ const project: Project = {
|
||||||
shape: 'circle',
|
shape: 'circle',
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
resetAlpha: false,
|
||||||
resolution: {
|
resolution: {
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
|
|
@ -18,7 +18,13 @@ 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 {createInputImage, name, operations, resolution} of projects) {
|
for (const {
|
||||||
|
createInputImage,
|
||||||
|
name,
|
||||||
|
operations,
|
||||||
|
resolution,
|
||||||
|
resetAlpha,
|
||||||
|
} of projects) {
|
||||||
const dataStart = performance.now();
|
const dataStart = performance.now();
|
||||||
const {width, height} = resolution;
|
const {width, height} = resolution;
|
||||||
|
|
||||||
|
@ -74,6 +80,15 @@ async function main(): Promise<void> {
|
||||||
...graph,
|
...graph,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (resetAlpha) {
|
||||||
|
await execa('convert', [
|
||||||
|
fullOutputFile,
|
||||||
|
'-alpha',
|
||||||
|
'Off',
|
||||||
|
fullOutputFile,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`* Writing ${compressedFile}`);
|
console.log(`* Writing ${compressedFile}`);
|
||||||
await execa('magick', [
|
await execa('magick', [
|
||||||
'convert',
|
'convert',
|
||||||
|
|
|
@ -4,6 +4,7 @@ export default interface Project {
|
||||||
createInputImage: boolean;
|
createInputImage: boolean;
|
||||||
name: string;
|
name: string;
|
||||||
operations: Array<InstanceType<typeof BaseOperation>>;
|
operations: Array<InstanceType<typeof BaseOperation>>;
|
||||||
|
resetAlpha: boolean;
|
||||||
resolution: {
|
resolution: {
|
||||||
height: number;
|
height: number;
|
||||||
width: number;
|
width: number;
|
||||||
|
|
Loading…
Reference in New Issue