# image-min

> Minify GIF, JPEG and PNG images

Latest version **0.3.2** (published 2014-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-min
pnpm add image-min
yarn add image-min
bun add image-min
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2014-08-31 |
| First published | 2013-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5721 |
| Author | Kevin Mårtensson |
| Maintainers | kevva, sindresorhus |
| Keywords | extract, tar, tar.gz, zip |

## Links

- npm: https://www.npmjs.com/package/image-min
- Repository: https://github.com/kevva/image-min
- Issues: https://github.com/kevva/image-min/issues
- npm.io page: https://npm.io/package/image-min

## Dependencies (7)

- [gifsicle](https://npm.io/package/gifsicle.md) ^0.1.0
- [through2](https://npm.io/package/through2.md) ^0.4.0
- [multipipe](https://npm.io/package/multipipe.md) 0.0.2
- [win-spawn](https://npm.io/package/win-spawn.md) ^2.0.0
- [optipng-bin](https://npm.io/package/optipng-bin.md) ^0.3.2
- [jpegtran-bin](https://npm.io/package/jpegtran-bin.md) ^0.2.0
- [pngquant-bin](https://npm.io/package/pngquant-bin.md) ^0.1.6

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.3.2 (latest) — 2014-08-31
- 0.4.5 — 2014-04-24
- 0.4.4 — 2014-04-23
- 0.4.2 — 2014-04-22
- 0.4.1 — 2014-04-22
- 0.4.0 — 2014-04-22
- 0.3.0 — 2014-04-03
- 0.2.3 — 2014-04-02
- 0.1.4 — 2014-04-01
- 0.2.2 — 2014-03-28
- 0.2.1 — 2014-03-28
- 0.2.0 — 2014-03-21
- 0.1.3 — 2014-01-17
- 0.1.2 — 2014-01-13
- 0.1.1 — 2013-12-21
- … 1 more at https://npm.io/package/image-min/versions

## README

# image-min [![Build Status](https://secure.travis-ci.org/kevva/image-min.png?branch=master)](http://travis-ci.org/kevva/image-min)

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

## Install

```bash
npm install --save image-min
```

## Usage

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

### pngquant (PNG only)

Type: `Boolean`  
Default: `false`

Whether to enable [pngquant](https://github.com/pornel/pngquant) lossy compression.

### progressive (JPEG only)

Type: `Boolean`  
Default: `false`

Lossless conversion to progressive.

## Used by

* [gulp-imagemin](https://github.com/sindresorhus/gulp-imagemin)
* [grunt-contrib-imagemin](https://github.com/gruntjs/grunt-contrib-imagemin)

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License) © [Kevin Mårtensson](http://kevinmartensson.com)

---
_Source: https://npm.io/package/image-min · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
