Threashold var implemented (for better text output)

This commit is contained in:
enny 2019-12-08 21:05:08 +01:00
parent 7090589354
commit a59f0515e8

View File

@ -312,12 +312,15 @@
function showHiddenCanvas() function showHiddenCanvas()
{ {
var threasholdRGB = 200;
var threasholdAlpha = 100;
for(var y = 0; y < yMax; y++) for(var y = 0; y < yMax; y++)
{ {
for(var x = 0; x < xMax; x++) for(var x = 0; x < xMax; x++)
{ {
var p = hiddenCtx.getImageData(x, y, 1, 1).data; 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; pixelBuffer[x+xMax*y] = 1;
} }