get("#348") -- rgb functions w, h = img.width, img.height g = 4 -- grid size r = {} for gy = 0, h-g, g do for gx = 0, w-g, g do local min, max = 1, 0 for y = gy, gy+g-1 do for x = gx, gx+g-1 do local b = bright(rgb(img.getInt(x, y))) min, max = math.min(min, b), math.max(max, b) end end if min < 0.5 and max > 0.5 then table.insert(r, gx..", "..gy..", "..gx+g..", "..gy+g) end end end return "Grid: "..table.concat(r, "|")