Giter Site home page Giter Site logo

vocalfan / millipng Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matejkosiarcik/planckpng

0.0 0.0 0.0 842 KB

Very thorough (and slow) png optimizer

License: GNU Lesser General Public License v3.0

Shell 39.77% Ruby 0.65% Python 49.20% Makefile 2.65% Dockerfile 7.72%

millipng's Introduction

millipng

Very slow png optimizer

dockerhub version github version

dockerhub automated status dockerhub build status

Overview

millipng is a .png meta-optimizer.

A meta-optimizer? millipng 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.

millipng is a lossless png optimizer (except removing exif and alpha channel color info).

millipng 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

millipng demo

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

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

When in doubt, get help:

$ docker run matejkosiarcik/millipng --help
usage: millipng [-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

Recommendation

For maximum optimization, I recommend

  1. call pngquant before millipng (beware pngquant is lossy)
  2. use --level ultra-brute in millipng (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/millipng --level ultra-brute

License

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

millipng's People

Contributors

matejkosiarcik avatar dependabot[bot] avatar mergify[bot] avatar toc-me[bot] avatar dillfrescott 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.