Skip to content

Instantly share code, notes, and snippets.

View webshru's full-sized avatar

Dmitry Shamrilo webshru

  • 19:01 (UTC +03:00)
View GitHub Profile
@webshru
webshru / imageBrightness.js
Created August 3, 2020 20:15 — forked from vincentorback/imageBrightness.js
Get Image Brightness
function getImageBrightness(imageSrc, callback) {
var img = document.createElement('img'),
colorSum = 0,
i = 0,
len,
canvas,
ctx,
imageData,
data,
brightness,