GithubHelp home page GithubHelp logo

jonathanmaron / image-optimizer Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 2.71 MB

A console tool to losslessly optimize PNG, JPEG and GIF files, using gifsicle, jpegoptim, jpegtran, pngcrush and pngout. It can usually reduce the filesize by 10% to 70%.

License: Other

PHP 100.00%
image-optimization optimize-images web-performance image-compression

image-optimizer's Introduction

Image Optimizer

Image optimization and compression tool for the console. This tool optimizes PNG, JPEG and GIF files, using gifsicle, jpegoptim, jpegtran, pngcrush and pngout and can usually reduce the filesize by 10% to 70%.

As optimzing images is CPU intensive and it may take several minutes for a larger PNG file, image-optimizer keeps track of which image files it has optimized. Each image file will only be optimize once, unless the --force flag is set.

image-optimizer is intended to be run unattended in a cronjob.

Example Usage

Optimize Images In /path/to/images

image-optimizer --path="/path/to/images"

Optimize Images In /path/to/images, Ignoring History

image-optimizer --path="/path/to/images" --force

Set All Images In /path/to/images As Optimized

image-optimizer --path="/path/to/images" --index-only

Installation

Installation is via composer:

cd ~/install-path

composer create-project jonathanmaron/image-optimizer

It is recommended to include ~/bin in your PATH variable:

PATH=$PATH:~/install-path/image-optimizer/bin

so that image-optimizer is available to the logged in user globally.

Upgrading From v1 and v2

Between v1 and v3, the structure of the history directory was updated. Therefore, please remove your current history directory. A new one, with the new structure, will be created when image-optimizer is executed for the first time:

rm -fr ~/.image_optimizer

Dependencies

image-optimizer depends upon gifsicle, jpegoptim, jpegtran, pngcrush and pngout to perform its work. These tools must be installed, otherwise image-optimizer will return an error.

Download and install pngout at:

http://static.jonof.id.au/dl/kenutils/pngout-20150319-linux-static.tar.gz (or newer)

then unpack, then copy to:

/usr/bin/pngout

Download and install other dependencies:

apt install pngcrush libjpeg-progs jpegoptim gifsicle

image-optimizer's People

Contributors

jonathanmaron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nelero

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.