get("#369") -- Magic Wand Algorithm, optimized get("#349") -- table functions wandSize = 4 function recttostring(r) return r.x..", "..r.y..", "..r.x+r.width..", "..r.y+r.height end allrects = {} for y = 0, img.height-1, 2 do for x = 0, img.width-1, 2 do r = magicWand(img, x, y) if r then allrects[recttostring(r)] = true end end end result = table.concat(keystolist(allrects), "|") return "Magic Wand All: "..result