Skip to main content

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 pngout as well. 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 may also nag you to use HTML5 video instead.

Picopt uncompresses, optimizes and rezips comic book archive files. Be aware that CBR rar archives will be rezipped into CBZs instead of CBR. Comic book archive optimization is off by defualt.

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 them.

Installation

Lossless external program packages

OS X

brew install optipng pngout jpeg gifsicle

Debian / Ubuntu

apt-get install optipng pngout libjpeg-progs gifsicle python-imaging

Redhat / Fedora

yum install optipng pngout libjpeg-progs gifsicle python-imaging

jpegrescan

jpegrescan is a better jpeg optimizer than jpegtran, unfortunately it remains unpackaged :(

git clone git@github.com:kud/jpegrescan.git
ln -s jpegrescan/jpegrescan /usr/local/bin/jpegrescan

Picopt

pip install picopt

Usage

Optimize all JPEG files in a dirctory:

picopt *.jpg

Optimize all 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 remember the last time I did this:

picopt -rSYt -D '2013 June 1 14:00' 'Pictures/iPhoto Library'

Packaged For

Alternatives

Imageoptim is an all-in-one OS X GUI optimizer. Imageoptim command line usage is possible with an external program.

Project details


Release history Release notifications

History Node

1.5.3

History Node

1.5.2

History Node

1.5.1

History Node

1.4.5

History Node

1.4.4

History Node

1.4.3

History Node

1.3.3

History Node

1.3.1

History Node

1.3.0

History Node

1.2.0

History Node

1.1.3

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.6

This version
History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.13.2

History Node

0.13.1

History Node

0.13.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
picopt-1.0.5-py2.py3-none-any.whl (15.2 kB) Copy SHA256 hash SHA256 Wheel 2.7 Apr 3, 2014
picopt-1.0.5.tar.gz (21.4 kB) Copy SHA256 hash SHA256 Source None Apr 3, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page