get("#348") -- rgb functions w, h = img.width, img.height g = 2 -- grid size r, rn = {}, 0 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) if min < 0.5 and max > 0.5 then rn=rn+1 r[rn] = gx..", "..gy..", "..gx+g..", "..gy+g goto next end end end ::next:: end end return "Grid: "..table.concat(r, "|")