Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 16, 2021 17:51
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 parzibyte/8303051eb900f1feab4d1f60773bdbbf to your computer and use it in GitHub Desktop.
Save parzibyte/8303051eb900f1feab4d1f60773bdbbf to your computer and use it in GitHub Desktop.
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