From a59f0515e8a2721cde1b3b02d93c655fe5af8895 Mon Sep 17 00:00:00 2001 From: enny Date: Sun, 8 Dec 2019 21:05:08 +0100 Subject: [PATCH] Threashold var implemented (for better text output) --- WebGUI.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WebGUI.html b/WebGUI.html index ca17c55..6ae3d59 100644 --- a/WebGUI.html +++ b/WebGUI.html @@ -312,12 +312,15 @@ function showHiddenCanvas() { + var threasholdRGB = 200; + var threasholdAlpha = 100; + for(var y = 0; y < yMax; y++) { for(var x = 0; x < xMax; x++) { var p = hiddenCtx.getImageData(x, y, 1, 1).data; - if((p[0] < 128 || p[1] < 128 || p[2] < 128) && p[3] > 128) + if((p[0] < threasholdRGB || p[1] < threasholdRGB || p[2] < threasholdRGB) && p[3] > threasholdAlpha) { pixelBuffer[x+xMax*y] = 1; }