diff --git a/docker/frontend/src/engine/exportEngine.ts b/docker/frontend/src/engine/exportEngine.ts index 0b1e9dd..37078e0 100644 --- a/docker/frontend/src/engine/exportEngine.ts +++ b/docker/frontend/src/engine/exportEngine.ts @@ -109,6 +109,11 @@ function release(owned: SkDisposable[], item: SkDisposable | null): void { disposeAll([item]); } +// The grain's roll of film: one seed per page load, hashed into the noise's +// domain so two runs never print the same clumps, while every render inside one +// session — the preview, the compare copy and the file — prints the same one. +const GRAIN_SEED = [Math.random() * 61.7, Math.random() * 43.9] as const; + function createSurface(width: number, height: number) { return Skia.Surface.MakeOffscreen(width, height) ?? Skia.Surface.Make(width, height); } @@ -458,6 +463,11 @@ export async function renderPhoto(input: RenderInput): Promise