Optimize image files and comic archives with external tools
Project description
A multi-format, recursive, multiprocessor aware, command line image optimizer utility that uses external tools to do the optimizing.
Picopt depends on Python PIL to identify files and rarfile to open CBRs.
To optimize JPEG images. Picopt needs either jpegrescan or jpegtran on the path. jpegrescan is preferred.
To optimize lossless images like PNG, PNM, GIF, TIFF and BMP, picopt requires either optipng, advpng or pngout be on the path. optipng provides the most advantage, but best results are acheived by using both utilities. advpng support is disabled by default and must be explicitly enabled on the command line.
Animated GIFs are optimized with gifsicle if it is available.
Picopt uncompresses, optimizes and rezips comic book archive files. Be aware that CBR rar archives will be rezipped into CBZs instead of CBR.
Picopt allows you to drop picopt timestamps at the root of your recursive optimization trees so you don’t have to remember which files to optimize or when you last optimized.
Installation
Lossless external programs
OS X
brew install optipng pngout jpeg gifsicle
Debian / Ubuntu
apt-get install optipng pngout libjpeg-progs gifsicle
Redhat / Fedora
yum install optipng pngout libjpeg-progs gifsicle
jpegrescan
git clone git@github.com:kud/jpegrescan.git ln -s jpegrescan/jpegrescan /usr/local/bin/jpegrescan
Dependancies
Debian / Ubuntu
apt-get install python-imaging
Picopt
pip install picopt
Usage
Optimize files:
picopt *.jpg
Optimize files and recurse directories:
picotpt -r *
Optimize files and recurse directories AND optimize comic book archives:
picopt -rc *
Optimize files, but not lossless files:
picopt -OPG *
Optimize files, but not jpegs:
picopt -JT *
Optimize files, but not animated gifs:
picopt -G *
Just list files picopt.py would try to optimize:
picopt -l *
Optimize everything in my iPhoto library, but only after the last time i did this, skipping symlinks to avoid massive amounts of duplicate work. Don’t convert lossless files to PNGs because that would confuse iPhoto. Also drop a timestamp file so I don’t have to remeber the last time I did this:
picopt -rSYt -D '2013 June 1 14:00' 'Pictures/iPhoto Library'
Packaged For
Alternatives
imageoptim is an OS X GUI optimizer. It integrates the various optimization programs so you don’t have to install them separately. It does not handle comic book archives. Its drag’n’drop UI is pretty nice. It also has AdvPNG support which I’ve disabled in picopt because I’ve never seen it provide any advantage. Command line usage is possible with an external program.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for picopt-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed15a5c26892fdf759b0928dc0094e1a89c74bb34a5bb6719c393356db6e12a1 |
|
MD5 | 898250f969e1f840e86f1a75ec78d141 |
|
BLAKE2b-256 | 1efa5225983ccbad470aede2948ba030aa97f5ad0e8d43c4879de007b71ec111 |