Skip to content

!!! OUT OF DATE, DO NOT USE!!! Original tagline: Ultra-brute PNG meta-optimizer

License

Notifications You must be signed in to change notification settings

matejkosiarcik/planckpng

Repository files navigation

PlanckPNG

Ultra-brute PNG meta-optimizer

dockerhub version github version

Overview

PlanckPNG is a .png meta-optimizer.

A meta-optimizer? PlanckPNG is not an optimizer by itself, it just calls multiple existing optimizers (Deflopt, Defluff, OptiPNG, PngOptimizer, PNGOUT, TruePNG, ZopfliPNG) in a specific order described by (not mine) analysis here: reddit.com/r/webdev/wiki.

PlanckPNG is a lossless PNG optimizer (except removing exif and alpha channel color info).

PlanckPNG is distributed as a docker image. This ensures consistent runtime environment with no configuration on your side (few of the included optimizers require wine to run on non Windows OS, which is already setup in the image).

Features

  • ✨ Best in class optimization
  • 📂 Optimize single file or whole directory

Usage

PlanckPNG demo

Linux & macOS

# optimize all pngs in current directory (recursively)
docker run -v "$PWD:/img" matejkosiarcik/planckpng

# optimize a single png
docker run -v "$PWD/image.png:/img" matejkosiarcik/planckpng

Windows

# optimize all PNGs in current directory (recursively)
docker run -v "%cd%:/img" matejkosiarcik/planckpng

# optimize a single PNG
docker run -v "%cd%/image.png:/img" matejkosiarcik/planckpng

Recommendations

For maximum optimization, I recommend

  1. call Pngquant before PlanckPNG (beware Pngquant is lossy)
  2. use --level ultra-brute in PlanckPNG (beware this takes a really long time for any sizible PNG)

Example:

pngquant --strip --speed 1 --skip-if-larger --quality 0-95 --force 'image.png' --output 'image.png'
docker run -v "$PWD/image.png:/img" matejkosiarcik/planckpng --level ultra-brute

Help

$ docker run matejkosiarcik/planckpng --help
usage: planckpng [-h] [-V] [-l {fast,default,brute,ultra-brute}] [-n] [-j JOBS]
                [-v | -q]

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -l {fast,default,brute,ultra-brute}, --level {fast,default,brute,ultra-brute}
                        Optimization level
  -n, --dry-run         Do not actually modify images
  -j JOBS, --jobs JOBS  Number of parallel jobs/threads to run (default is 0 -
                        automatically determine according to current cpu)
  -v, --verbose         Additional logging output
  -q, --quiet           Suppress default logging output

License

The project is licensed under LGPLv3. See LICENSE.txt for full details.