Allow blending two images together

This commit is contained in:
2024-02-13 14:23:28 +01:00
parent d37e34010f
commit 3dfd31d93f
2 changed files with 16 additions and 2 deletions

5
src/processing/merge.ts Normal file
View File

@@ -0,0 +1,5 @@
export function mergeImages(pixels: Uint8ClampedArray, destination: Uint8ClampedArray) {
for (let i = 0; i < destination.length; i += 1) {
destination[i] = pixels[i] * 0.5 + destination[i] * 0.5;
}
}