File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # https://pngquant.org/
4+ # On Mac: brew install pngquant
5+
6+ # Options:
7+ # --ext .png Output to same filename, don't append anything else
8+ # --force Overwrite existing output files
9+ # --speed 1 Slow speed, best quality
10+ # --strip Remove optional metadata
11+
12+ pngquant --ext .png --force --speed 1 --strip assets/* .png img/* .png
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ # encoding: utf-8
3+ """
4+ Thumbnail images to a maximum of 160px wide and 80px high
5+ """
6+ import glob
7+
8+ from PIL import Image # pip install pillow
9+
10+ max_size = 160 , 80
11+
12+ for infile in glob .glob ("assets/*.png" ):
13+ im = Image .open (infile )
14+ im .thumbnail (max_size )
15+ im .save (infile )
You can’t perform that action at this time.
0 commit comments