Debian Codegraph @

dist/pillow-resize

raw
1 #!/usr/bin/env python3
2 # SPDX-License-Identifier: CC0-1.0
3
4 # Simple and dumb Pillow-based resizer
5 # Usage: pillow-resize src-img.png dst-img.png WIDTH HEIGHT
6
7 import sys
8 from PIL import Image
9
10 img = Image.open(sys.argv[1])
11 img.thumbnail((int(sys.argv[3]), int(sys.argv[4])))
12 img.save(sys.argv[2])