get("#348") -- bright and rgb w, h = img.width, img.height min, max = 1, 0 for y = 0, h-1 do for x = 0, w-1 do b = bright(rgb(img.getInt(x, y))) min, max = math.min(min, b), math.max(max, b) end end minp = math.floor(min*100+0.5) maxp = math.floor(max*100+0.5) return "Brightness range: "..minp.."-"..maxp.."%"