# ndarray-lanczos

> Resize an ndarray with Lanczos resampling

Latest version **0.3.0** (published 2023-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install ndarray-lanczos
pnpm add ndarray-lanczos
yarn add ndarray-lanczos
bun add ndarray-lanczos
```

## Health

**Score 40/100 (D)** — status: abandoned.

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

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2023-02-24 |
| First published | 2021-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 42.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Don McCurdy |
| Maintainers | donmccurdy |

## Links

- npm: https://www.npmjs.com/package/ndarray-lanczos
- Repository: https://github.com/donmccurdy/ndarray-lanczos
- Homepage: https://github.com/donmccurdy/ndarray-lanczos#readme
- Issues: https://github.com/donmccurdy/ndarray-lanczos/issues
- npm.io page: https://npm.io/package/ndarray-lanczos

## Dependencies (2)

- [ndarray](https://npm.io/package/ndarray.md) ^1.0.19
- [@types/ndarray](https://npm.io/package/@types/ndarray.md) ^1.0.11

## Recent versions

- 0.3.0 (latest) — 2023-02-24
- 0.2.0 — 2023-02-11
- 0.1.2 — 2021-09-17
- 0.1.1 — 2021-05-25
- 0.1.0 — 2021-05-25

## README

# ndarray-lanczos

[![Latest NPM release](https://img.shields.io/npm/v/ndarray-lanczos.svg)](https://www.npmjs.com/package/ndarray-lanczos)
[![License](https://img.shields.io/badge/license-MIT-007ec6.svg)](https://github.com/donmccurdy/ndarray-lanczos/blob/main/LICENSE)
[![Minzipped size](https://badgen.net/bundlephobia/minzip/ndarray-lanczos)](https://bundlephobia.com/result?p=ndarray-lanczos)
[![CI](https://github.com/donmccurdy/ndarray-lanczos/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/donmccurdy/ndarray-lanczos/actions?query=workflow%3ACI)
[![Coverage](https://codecov.io/gh/donmccurdy/ndarray-pixels/branch/main/graph/badge.svg?token=S30LCC3L04)](https://codecov.io/gh/donmccurdy/ndarray-pixels)

Resize an [ndarray](https://www.npmjs.com/package/ndarray) with [Lanczos resampling](https://en.wikipedia.org/wiki/Lanczos_resampling).

## Quickstart

Installation:

```
npm install --save ndarray-lanczos
```

Use:

```ts
import ndarray from 'ndarray';
import { getPixels, savePixels } from 'ndarray-pixels';
import { lanczos3 } from 'ndarray-lanczos';

// Read PNG.
const srcPixels = await getPixels('full-size.png');

// Resize with Lanczos 3 resampling.
const dstPixels = ndarray(new Uint8Array(width * height * 4).fill(0), [width, height, 4]);
lanczos3(srcPixels, dstPixels);

// Write PNG.
const data = await savePixels(dstPixels, 'image/png'); // → Uint8Array
```

Two filtering methods, `lanczos3` and `lanczos2`, are included.

## Credits

Thanks to https://github.com/rgba-image/lanczos and https://github.com/nodeca/pica.

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