javascript canvas gamma correction
var gamma = 2.2;
var gammaCorrection = 1 / gamma;
for (var y = 0; y < height; y++) {
for (var x = 0; x < width; x++) {
var oldColor = getPixel(x, y);
var newColor = [
Math.pow((oldColor[0] / 255), gammaCorrection) * 255,
Math.pow((oldColor[1] / 255), gammaCorrection) * 255,
Math.pow((oldColor[2] / 255), gammaCorrection) * 255
];
updatePixel(x, y, newColor[0], newColor[1], newColor[2]);
}
}
renderPixels();
Also in JavaScript:
- jquery foreach
- javascript get midnight tonight
- how to check has class name in js?
- jQuery element with multiple classes
- click point invert zoom react simple map
- node js catch any errors
- react functional components
- currentTime(); javascript
- how to add thumbnail image carousel in javascript fancybox
- toggle one class add and one class remove same time and after click remove class add and add class remove jquery
- httpmodule import angular 9
- ssr in angular 9 example
- regex special characters javascript
- inject image javascript
- how to check if a javascript object is empty
- get form response with javascript
- js get class property
- first non repeating character javascript
- Create a 'uniqueWords' function that accepts a string 'str' and returns an array of all the unique words in that string.
- google sheets get ranges
- Javascript append item to array
- same file select angular second time not selected
- detect a click outside an element javascript
- how to learn javascript