get("#372") -- getContrast brightnessThreshold = 0.55 -- convert pixel by pixel w, h = img.width, img.height pixels = {} for y = 0, h-1 do for x = 0, w-1 do b = bright(rgb(img.getInt(x, y))) pixels[y*w+x+1] = b >= brightnessThreshold and -1 or 0 end end