Giter Site home page Giter Site logo

picopt's Introduction

picopt

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 Python rarfile to open CBRs.

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

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 [email protected]:kud/jpegrescan.git
ln -s jpegrescan/jpegrescan /usr/local/bin/jpegrescan

MozJPEG

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

Picopt

pip install picopt

Usage

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

picopt's People

Contributors

ajslater avatar crass00 avatar dmgawel avatar

Watchers

James Cloos avatar Gabriel Taylor Russ avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.