Last time I played with played with Pixels - Color Effect with HTML5 and JS
For this short post, let's go back to basics. Let us try to adjust an image's brightness by trying to add a value between -255 (darkest ) to 255 (lightest) to an image pixel data.
SOURCE CODE - https://jsfiddle.net/HumpreyCogay/upbnvnsb/
NOTE - an image can be loaded to an ImageData, The data attribute of this object contains a
Uint8ClampedArray representing a one-dimensional array containing the data in the RGBA order, with integer values between 0 and 255 (included).
below is a short sample on how to read the RGB data parts.
RED = imageData[c ]
GREEN = imageData[c+1]
BLUE = imageData[c+2]