# image-batch

> Batch images resizing. [NO NATIVE DEPENDENCIES]

Latest version **0.0.4** (published 2016-08-07) · MIT license · 0 weekly downloads

## Install

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

Provides the command `image-batch`.

## 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.0.4 |
| Published | 2016-08-07 |
| First published | 2016-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12 |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Andrew Medvedev |
| Maintainers | andrew.medvedev |
| Keywords | image, image-processing |

## Links

- npm: https://www.npmjs.com/package/image-batch
- Repository: https://github.com/andrew-medvedev/image-batch
- Homepage: https://github.com/andrew-medvedev/image-batch#readme
- Issues: https://github.com/andrew-medvedev/image-batch/issues
- npm.io page: https://npm.io/package/image-batch

## Dependencies (6)

- [jimp](https://npm.io/package/jimp.md) ^0.2.24
- [async](https://npm.io/package/async.md) ^2.0.0-rc.6
- [winston](https://npm.io/package/winston.md) ^2.2.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.30.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [recursive-readdir](https://npm.io/package/recursive-readdir.md) ^2.0.0

## 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

- 0.0.4 (latest) — 2016-08-07

## README

# Batch images resizing [NO NATIVE DEPENDENCIES NEEDED]
[![Build Status](https://travis-ci.org/andrew-medvedev/image-batch.svg?branch=master)](https://travis-ci.org/andrew-medvedev/image-batch)

Easy module for resizing of large amount of images

Powered by [Jimp](https://www.npmjs.com/package/jimp) which does not require any native dependencies

Just use
```bash
image-batch -D path/to/images --resize 50% --postfix m
```

## Motivation

Need to resize huge amount of images.

For example here is directory with big amount of device mockups of different image types:

    iphone_6.png
    iphone_6_gold.jpg
    iphone_mockup.jpg
    mockup_htc_8.png
    galaxy-note-4-psd-mockup.png

The task: Produce iPhone mockups of 3 types(100% size with -l postfix, 50% size with -m postfix and 25% size with -s postfix) and png format.

Here is how to get things done with `image-batch`:
Let's create 100% size mockups for beginning:
```bash
image-batch -D path/to/mockups --name iphone% --resize 100% --save-as png --postfix l
```
Now our directory look like this:

    iphone_6.png
    iphone_6_gold.jpg
    iphone_mockup.jpg
    iphone_6-l.png
    iphone_6_gold-l.png
    iphone_mockup-l.png
    mockup_htc_8.png
    galaxy-note-4-psd-mockup.png

Next we need 50% size mockups:
```bash
image-batch -D path/to/mockups --name iphone% --no-name iphone%-l --resize 50% --save-as png --postfix m
```

And 25% size:
```bash
image-batch -D path/to/mockups --name iphone% --no-name iphone%-l,iphone%-m --resize 25% --save-as png --postfix s --remove-original
```

Here is how our directory should look like on finish:

    iphone_6-l.png
    iphone_6_gold-l.png
    iphone_mockup-l.png
    iphone_6-m.png
    iphone_6_gold-m.png
    iphone_mockup-m.png
    iphone_6-s.png
    iphone_6_gold-s.png
    iphone_mockup-s.png
    mockup_htc_8.png
    galaxy-note-4-psd-mockup.png

## Installation

```bash
npm install -g image-batch
```

## Usage

```bash
image-batch --help
```

```bash
Usage: image-batch [options]

Options:
 -V, --version          Prints version
 -H, --help             Prints this message

 -R, --resize           Set resize query
 -D, --directory                Set base directory where images are
 -N, --name             Filename search pattern. Can be listed with comma
 -NN, --no-name         Filename excluding pattern. Can be listed with comma
 -OF, --only-format             Set exclusive image format to process
 -WOF, --without-format         Set image format that will be not processed
 -P, --postfix          Set name postfix for output files
 -F, --formats          Set exclusive list of formats separated by commas
 -S, --save-as          Set format for output files
 -REMOVE, --remove-original             Set remove original files flag
```

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