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
| ID | Author/Program | Comment | Date | |
|---|---|---|---|---|
| 627 | #1000610 | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { 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 }} | 2015-08-19 01:14:41 | delete |
| 625 | #1000604 (pitcher) | 2015-08-18 00:07:22 |