get("#348") w, h = img.width, img.height total = 0 for y = 0, h-1 do sum = 0 for x = 0, w-1 do sum = sum+bright(rgb(img.getInt(x, y))) end sum = sum/w expected = 1-(y+1)/h total = total+math.abs(sum-expected) print("y", y, "total", total) end sim = 1-total/h return "Triangleness: "..sim