Skip to content

Latest commit

 

History

History
61 lines (37 loc) · 1.33 KB

README.md

File metadata and controls

61 lines (37 loc) · 1.33 KB

image-min Build Status

Minify GIF, JPEG and PNG images seamlessly with Node.js.

Getting started

Install with npm: npm install image-min

Examples

var fs = require('fs');
var imagemin = require('image-min');
var path = require('path');

var src = fs.createReadStream('img.gif');
var ext = path.extname(src.path);

src
    .pipe(imagemin({ ext: ext }))
    .pipe(fs.createWriteStream('img-minified' + ext));

API

imagemin(opts)

Optimize a GIF, JPEG, or PNG image by providing a an ext. Use the options below (optionally) to configure how your images are optimized.

Options

ext

Type String
Default: undefined

File extension used by imagemin to determine which optimizer to use.

interlaced (GIF only)

Type: Boolean
Default: false

Interlace gif for progressive rendering.

progressive (JPEG only)

Type: Boolean
Default: false

Lossless conversion to progressive.

Used by

License

MIT License (c) Kevin Mårtensson