skip to navigation
skip to content

picopt 1.3.0

Optimize image files and comic archives with external tools

A multi-format, recursive, multiprocessor aware, command line lossless image optimizer utility that uses external tools to do the optimizing.

Picopt depends on Python PIL to identify files and Python rarfile to open CBRs.

The actual image optimization is accomplished by external programs.

To optimize JPEG images. Picopt needs one of mozjpeg, jpegrescan or jpegtran on the path. in order of preference.

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 nag you to convert your file to HTML5 video, but does not provide this service itself.

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 not turned on by default to prevent surprises.

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.


Lossless external program packages


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 is a better jpeg optimizer than jpegtran, unfortunately it remains unpackaged :(

git clone
ln -s jpegrescan/jpegrescan /usr/local/bin/jpegrescan


mozjpeg is a better option than even jpegrescan. As of Oct 2014 it may or may not be packaged for your *nix, but even when it is, picopt requires that its separately compiled version of jpegtran be symlinked to ‘mozjpeg’ somewhere in the path. This installation example is for OS X: brew install mozjpeg ln -s /usr/local/Cellar/mozjpeg/2.1/bin/jpegtran /usr/local/bin/mozjpeg


pip install picopt


Optimize all JPEG files in a dirctory:

picopt *.jpg

Optimize all files and recurse directories:

picopt -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 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


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

File Type Py Version Uploaded on Size
picopt-1.3.0-py2.py3-none-any.whl (md5) Python Wheel 2.7 2015-09-01 34KB
picopt-1.3.0.tar.gz (md5) Source 2015-09-01 22KB
  • Downloads (All Versions):
  • 34 downloads in the last day
  • 282 downloads in the last week
  • 2010 downloads in the last month