edit · print · PDF

Please note that all the SIEpedia's articles address specific issues or questions raised by IAC users, so they do not attempt to be rigorous or exhaustive, and may or may not be useful or applicable in different or more general contexts.

Resizing a list of images with python

japp


#! /usr/bin/env python


#*******************************************************************************
#  Reduce el tamaño de imagenes JPEG, GIF o PNG
#  Necesita Python Image Library (PIL)
#
#  USO:  python miniaturas.py -f imagen_1.jpg imagen_2.gif ...
#        python miniaturas.py -a       # reduce todas las imagenes del directorio
#*******************************************************************************
" ----------------------------------------------------------"" Reduce imagenes jpg, png o gif al tamaño indicado"" USO: miniaturas imagen_1.jpg imagen_2.png ...""      miniaturas -a  (Todas las imagenes)"" ----------------------------------------------------------"'''-''a''*.jpg''*.gif''*.png''f'# Crea el directorio "mini" si no existe
'mini''mini''''Tamaño máximo de lado (pixel): '".tmp"'JPEG'"JPEG"'mini/''PNG'"PNG"'mini/''GIF'"GIF"'mini/'"Reduciendo imagen: ""Error en la imagen: "'------------------------------------------------------------''Reducidas(s) '' imagen(es) en el directorio "mini/".'' '
 

Section: HOWTOs

edit · print · PDF
Page last modified on April 30, 2008, at 11:08 AM