Skip to content

Instantly share code, notes, and snippets.

@octohedron
Created August 11, 2015 15:49
Show Gist options
  • Save octohedron/1206fab973a5ad0f5d22 to your computer and use it in GitHub Desktop.
Save octohedron/1206fab973a5ad0f5d22 to your computer and use it in GitHub Desktop.
# Clean the background noise, if color != black, then set to white.
for y in xrange(img.size[1]):
for x in xrange(img.size[0]):
if not(pixdata[x, y][0] > threshold \
and pixdata[x, y][1] > threshold \
and pixdata[x, y][2] > threshold):
pixdata[x, y] = (0, 0, 0, 255)
else:
pixdata[x, y] = (255, 255, 255, 255)
counter = 0;
old_x = -1;
letterlist = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment