# imgresizer-node

> A node library to resize images using ImageMagick

Latest version **1.1.2** (published 2016-07-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install imgresizer-node
pnpm add imgresizer-node
yarn add imgresizer-node
bun add imgresizer-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2016-07-18 |
| First published | 2016-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kai Hesk |
| Maintainers | jrhess |
| Keywords | imagemagick, image, resize |

## Links

- npm: https://www.npmjs.com/package/imgresizer-node
- Repository: https://github.com/ONode/imgresizer-node
- Homepage: https://github.com/ONode/imgresizer-node#readme
- Issues: https://github.com/ONode/imgresizer-node/issues
- npm.io page: https://npm.io/package/imgresizer-node

## Dependencies (2)

- [async](https://npm.io/package/async.md) ~2.0.0
- [imagemagick](https://npm.io/package/imagemagick.md) ~0.1.3

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2016-07-18

## README

# imgresizer-node
resize images on the server size
==================

A node library to resize images using ImageMagick

you need [ImageMagick](http://www.imagemagick.org/) on your system

## install

You need imagemagick on your machine.

For Windows - download the [ImageMaigck Installer](http://www.imagemagick.org/script/binary-releases.php#windows)

For Linux:

```
$ sudo apt-get install imagemagick
```

## usage

Resize a folder of images and write to a new folder.

Each image is resized multiple times.

```js
var resize = require('imgresizer-node')()

resize.folder('./imgs', './output', [{
  width:1024,
  height:768
},{
  width:102,
  height:77,
  name:'thumb'
}], function(){
	console.log('images resized!');
})
```

Resize a single image and control what size the output is written at:

### The basic control format for the single image resize




```js

const config_basic = {

    size: {
        width: 400,

        //proportional based on height in px
        height: 600
    },

    // jpg format or png format
    format: "jpg",

    //the quality from 0.0 to 1.0
    quality: 1.0
};


/**
 * process single image
 * @param inpath path for input
 * @param outpath path for output
 * @param options the process configurations
 * @param done the callback
 */

resize.image('./imgs/balloon.jpg', './output/balloon.jpg', config_basic, function(err){
	console.log('image is resized')
})

```

If ./imgs was a folder with:

 * image1.png (2048 x 1536)
 * image2.png (2048 x 1536)

Then ./output would contain:

 * image1.png (1024 x 768)
 * image1.thumb.png (102 x 77)
 * image2.png (1024 x 768)
 * image2.thumb.png (102 x 77)

## installation

```
$ npm install imgresizer-node
```

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