C2 样式调整曝光度与对比度 2

This commit is contained in:
ciaochaos 2020-05-17 20:14:58 +08:00
parent 4773adbb32
commit a0c0055c0f
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ function getGrayPointList(params, size, black, white) {
let imageData = ctx.getImageData(x, y, 1, 1); let imageData = ctx.getImageData(x, y, 1, 1);
let data = imageData.data; let data = imageData.data;
let gray = gamma(data[0], data[1], data[2]); let gray = gamma(data[0], data[1], data[2]);
if (Math.random() > ((gray / 255) - 0.5) * (contrast + 1) + 0.5 + exposure && ( x % 3 !== 1 || y % 3 !== 1 ) ) gpl.push(<use key={"g_" + x + "_" + y} x={x} y={y} xlinkHref={black} />); if (Math.random() > ((gray / 255) + exposure - 0.5) * (contrast + 1) + 0.5 && ( x % 3 !== 1 || y % 3 !== 1 ) ) gpl.push(<use key={"g_" + x + "_" + y} x={x} y={y} xlinkHref={black} />);
} }
} }
resolve(gpl); resolve(gpl);