Created
May 28, 2013 22:06
-
-
Save alejandroave/5666538 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def escala(imagen): | |
ancho,altura,pixels,im = cargar(imagen) | |
for i in range(ancho): | |
for j in range(altura): | |
(a,b,c) = pixels[i,j] | |
suma = a+b+c | |
prom = int(suma/3) | |
a = prom ##igualamos | |
b = prom ##igualamos | |
c = prom ##igualamos | |
pixels[i,j] = (a,b,c) ##igualamos | |
im.save("gris.jpg") ##guardamos la imagen nueva | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment