Teachers open the door but You must enter by yourself.
Rij = 0.941 * Lij
Gij = 0.784 * Lij
Bij = 0.569 * Lij
window.addEventListener('load', function(){
const canvas = document.getElementById('canvas');
canvas.height = canvas.width*1.333;
const context = canvas.getContext('2d');
const image = new Image();
image.src = 'ip/original.jpg';
image.addEventListener("load", function(){
context.drawImage(image,0,0);
const x = context.getImageData(0,0,canvas.width,canvas.height);
for (let i=0; i < x.data.length; i+=4) {
const gray=x.data[i]*0.299+x.data[i+1]*0.587+x.data[i+2]*0.114;
x.data[i]=0.941*gray;
x.data[i+1]=0.784*gray;
x.data[i+2]=0.569*gray;
}
context.putImageData(x,0,0);
});
});
This site is powered by