-
-
Save parzibyte/8303051eb900f1feab4d1f60773bdbbf 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 reflejo_horizontal(nombre_imagen): | |
matriz = leer_imagen(nombre_imagen) | |
ancho = len(matriz[0]) | |
alto = len(matriz) | |
for y in range(alto): | |
for x in range(int(ancho/2)): | |
indice_opuesto = ancho - x - 1 | |
opuesto = matriz[y][indice_opuesto] | |
actual = matriz[y][x] | |
matriz[y][indice_opuesto] = actual | |
matriz[y][x] = opuesto | |
return matriz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment