get("#348") -- bright and rgb function getContrast(img) local w, h = img.width, img.height local min, max = 1, 0 for y = 0, h-1 do for x = 0, w-1 do local b = bright(rgb(img.getInt(x, y))) min, max = math.min(min, b), math.max(max, b) end end local minp = math.floor(min*100+0.5) local maxp = math.floor(max*100+0.5) return minp, maxp, min, max end
Began life as a copy of #371
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
2 comment(s) hidden. show