Skip to content

Instantly share code, notes, and snippets.

Created October 9, 2012 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3858770 to your computer and use it in GitHub Desktop.
Save anonymous/3858770 to your computer and use it in GitHub Desktop.
entrada 1
#!/usr/bin/env python
#Importamos las librerias necesarias
import Image, sys
#Variables
x = 1
y = 1
#Abrimos la huella que ocupamos
im = Image.open("img1.png")
#Hacemos un recorrido en largo y ancho de la imagen por pixeles
for y in range(0,209): #Largo
for x in range(0,180): #Ancho
pix = im.load()
pix[x, y]
if pix[x,y] == (255,255,255): #Si se encuentra un punto blanco se guarda 1
c= 1
else:
c= 0 #Si no es blanco entonces se guarda 0
print c #Imprimimos en terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment