# hexo-filter-variant-images

> A plug-in to generate variant images

Latest version **0.0.1** (published 2017-04-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install hexo-filter-variant-images
pnpm add hexo-filter-variant-images
yarn add hexo-filter-variant-images
bun add hexo-filter-variant-images
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-04-21 |
| First published | 2017-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yuta Haga |
| Maintainers | yutahaga |
| Keywords | hexo, filter, thumbnail, image |

## Links

- npm: https://www.npmjs.com/package/hexo-filter-variant-images
- Repository: https://github.com/yutahaga/hexo-filter-variant-images
- Homepage: https://github.com/yutahaga/hexo-filter-variant-images#readme
- Issues: https://github.com/yutahaga/hexo-filter-variant-images/issues
- npm.io page: https://npm.io/package/hexo-filter-variant-images

## Dependencies (2)

- [minimatch](https://npm.io/package/minimatch.md) ^3.0.3
- [stream-to-buffer](https://npm.io/package/stream-to-buffer.md) ^0.1.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.1 (latest) — 2017-04-21

## README

# hexo-filter-variant-images

[![npm version](https://badge.fury.io/js/hexo-filter-variant-images.svg)](https://badge.fury.io/js/hexo-filter-variant-images)

It is a Hexo plug-in for generating thumbnails etc. using ImageMagick.

Since you can freely set arguments, you can generate various kinds of images as well as thumbnails.

## Required environment

* ImageMagick

## Installation

```sh
npm install hexo-filter-variant-images --save
```

## Configuration

```yml
# variant images
variant_images:
  cmd: 'magick'
  match: '**/*.{jpg,gif,png}'
  match_options:
    debug: true
  exclude: 'static/**/*'
  priority: 5
  items:
    - suffix: '@preview'
      extension: 'gif'
      size: '20x20'
      blur: '1.5'
      posterize: '16'
      args: '-resize $size -blur $blur -posterize $posterize'
    - suffix: '@small'
      size: '120x120'
      args: '-resize $size'
```

### cmd
Run command. The default value is `magick`.

Also I am only checking the operation with `magick`.

### match
Specify the path of the target image file with glob.

The default value is `**/*.{jpg,gif,png}`

### match_options

Option for minimatch. The default value is empty.

For details [Minimatch#options](https://github.com/isaacs/minimatch#options)

### exclude
Specify the path of the file to be excluded with glob. The default value is empty.

### priority
Specify the priority of the filter by numerical value. The default value is `5`.

For details [Filter | Hexo](https://hexo.io/api/filter.html)

### items

Variations to generate. Required items are `suffix, args`

#### suffix
Suffix of the generated image.

#### extension
Extension of the generated image. If unspecified, it will have the same extension as the original image.

#### args
Arguments to pass to the command. If you write it like `$size`, you can refer to the settings in the same item.

```yml
items:
  - suffix: '@preview'
    extension: 'gif'
    size: '20x20'
    blur: '1.5'
    posterize: '16'
    args: '-resize $size -blur $blur -posterize $posterize'
  - suffix: '@small'
    args: '-resize 120x120'
```

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