# @dylanvann/convert-image

> convert-image

Latest version **0.0.5** (published 2020-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dylanvann/convert-image
pnpm add @dylanvann/convert-image
yarn add @dylanvann/convert-image
bun add @dylanvann/convert-image
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2020-09-30 |
| First published | 2020-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 34.9 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | Dylan Vann |
| Maintainers | dylanvann |
| Keywords | fast, image |

## Links

- npm: https://www.npmjs.com/package/@dylanvann/convert-image
- Repository: https://github.com/DylanVann/react-fast-image
- Homepage: https://github.com/DylanVann/react-fast-image#readme
- Issues: https://github.com/DylanVann/react-fast-image/issues
- npm.io page: https://npm.io/package/@dylanvann/convert-image

## Dependencies (8)

- [sharp](https://npm.io/package/sharp.md) ^0.26.1
- [yargs](https://npm.io/package/yargs.md) ^16.0.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [ffmpeg-static](https://npm.io/package/ffmpeg-static.md) ^4.2.7
- [fluent-ffmpeg](https://npm.io/package/fluent-ffmpeg.md) ^2.1.2
- [ffprobe-static](https://npm.io/package/ffprobe-static.md) ^3.0.0
- [json-stringify-deterministic](https://npm.io/package/json-stringify-deterministic.md) ^1.0.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2020-09-30
- 0.0.4 — 2020-09-29
- 0.0.3 — 2020-09-29
- 0.0.2 — 2020-09-29
- 0.0.1 — 2020-09-29

## README

# convert

This converts images and videos into a suitable format for `FastImage`.

-   We use [sharp](https://sharp.pixelplumbing.com/) for images.
-   We use [ffmpeg](https://www.ffmpeg.org/) for videos.
-   Conversions are cached to speed things up.

This package allows you to specify multiple output formats at the same time.
This can be done to speed up conversion.

## Installation

```bash
yarn add fast-image-convert
```

### Usage

```typescript
import { convert } from 'fast-image-convert'

const myOutput = await convert('./my-image.mp4', {
    inputFile: 'myImage.png',
    outputFolder: 'public',
    conversions: [
        { format: 'png', width: 500, quality: 80 },
        { format: 'webp', width: 500, quality: 80 },
        { format: 'jpeg', width: 500, quality: 80 },
        { format: 'mp4', width: 500, quality: 80 },
    ],
})

const myOutput = [
    {
        output: 'public/12345.png',
        width: 500,
        height: 300,
    },
    {
        output: 'public/12345.webp',
        width: 500,
        height: 300,
    },
    {
        output: 'public/12345.jpeg',
        width: 500,
        height: 300,
    },
    {
        output: '12345',
        width: 500,
        height: 300,
    },
    {
        output: 'public/12345.mp4',
        width: 500,
        height: 300,
    },
]
```

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