# ndarray-downsample2x

> Downsample by a factor of two using sinc interpolation

Latest version **0.1.1** (published 2013-07-02) · MIT license · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2013-07-02 |
| First published | 2013-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | downsample, ndarray, power, of, two, sinc, interpolation |

## Links

- npm: https://www.npmjs.com/package/ndarray-downsample2x
- Repository: https://github.com/mikolalysenko/ndarray-downsample2x
- Issues: https://github.com/mikolalysenko/ndarray-downsample2x/issues
- npm.io page: https://npm.io/package/ndarray-downsample2x

## Dependencies (4)

- [cwise](https://npm.io/package/cwise.md) ~0.3.3
- [ndarray-fft](https://npm.io/package/ndarray-fft.md) ~0.1.0
- [ndarray-ops](https://npm.io/package/ndarray-ops.md) ~1.1.0
- [ndarray-scratch](https://npm.io/package/ndarray-scratch.md) ~0.0.1

## Recent versions

- 0.1.1 (latest) — 2013-07-02
- 0.1.0 — 2013-07-02
- 0.0.1 — 2013-07-02
- 0.0.0 — 2013-07-02

## README

ndarray-downsample2x
====================
Downsamples an ndarray by a factor of 2 using sinc interpolation.

## Example
Here is a simple example showing how to downsample an image:

```javascript
var lena = require("luminance")(require("lena"))
var x = require("zeros")([256,256])
require("ndarray-downsample2x")(x, lena, 0, 255)
require("save-pixels")(x, "png").pipe(process.stdout)
```

And here is the result:

<img src=example/lena2.png>

##Install

    npm install ndarray-downsample2x
    
### `require("ndarray-downsample2x")(output, input[, clamp_lo, clamp_hi])`
Downsamples input by a factor of two storing the result in output.

* `output` gets the result of downsampling
* `input` is the array that gets downsampled
* `clamp_lo` is a threshold placed on the pixeks
* `clamp_hi` is an upper threhsold placed on the pixels

**Note** `input`'s shape must be divisible by 4 and `output`'s shape must be one half of `input`'s along each dimension.

## Credits
(c) 2013 Mikola Lysenko. MIT License

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