I need to manipulate pixels in an image and save integer values (0-255) in RGBA values.
let imageData = this.context.getImageData(0, 0, this.width, this.height);
imageData.data[1448] = 10;
imageData.data[1449] = 20;
imageData.data[1450] = 30;
imageData.data[1451] = 40;
this.context.putImageData(imageData, 0, 0);
After get ImageData again and print values in their respective indexes, this is the result:
IDX 1448: 13
IDX 1449: 19,
IDX 1450: 32
IDX 1451: 40
Because the value assigned is not the same as the rescued value???
Thanks!