Skip to content

Instantly share code, notes, and snippets.

@mevangelista-alvarado
Forked from xtornasol512/resize1920.py
Created July 29, 2020 15:23
Show Gist options
  • Save mevangelista-alvarado/408670b187de5ead00aa40243aacdc47 to your computer and use it in GitHub Desktop.
Save mevangelista-alvarado/408670b187de5ead00aa40243aacdc47 to your computer and use it in GitHub Desktop.
Wand, Python, resize 1920 and quality 92 or more
# -*- coding: utf-8 -*-
"""
Author: Jesus A. Garzon
github: xtornasol512
twitter: xtornasol512
Description:
Just put this script in your directory of images
After create a directory for img_result
Then execute the script
python resize1920.py
Enjoy having more time to do another things :P
"""
import os
from wand.image import Image
#List of Files or Current Directory
files = os.listdir(os.curdir)
#Remove script and the directory of result
files.remove('resize1920.py')
files.remove('imgNew')
#We can order or not just like you prefer :D
files = sorted(files)
for f in files:
image = Image(filename=f)
with image.clone() as img:
img.transform(resize='1920')
img.compression_quality= 93
img.save(filename='imgNew/1920x_' + f)
print f
print 'nuevo tamaño: ', img.size
@xtornasol512
Copy link

Ejemplo de Tamaños
200px 100px REAL
400px Resize recomendado
72 DPI para compression quality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment