Skip to content

Instantly share code, notes, and snippets.

@tecsify
Last active May 12, 2021 16:22
Show Gist options
  • Save tecsify/c034c3165c2738c83c8a5cb99a25787d to your computer and use it in GitHub Desktop.
Save tecsify/c034c3165c2738c83c8a5cb99a25787d to your computer and use it in GitHub Desktop.
"""Procesamiento de imágenes con Python por #Tecsify
Puedes ver la guía completa de este código en nuestro blog:
https://tecsify.com/blog/guia-imagenes-python/ """
from PIL import Image, ImageFilter
DirectorioImagen = r'Directorio\Tecsify.png'
img = Image.open(DirectorioImagen).convert('LA')
img.show()
img = Image.open(DirectorioImagen).filter(ImageFilter.BoxBlur(30))
img.show()
img = Image.open(DirectorioImagen).filter(ImageFilter.FIND_EDGES)
img.show()
img = Image.open(DirectorioImagen).filter(ImageFilter.CONTOUR)
img.show()
img.save(r'Directorio\NuevaImagen.png') #Esto guardará la ultima image filtrada.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment