clip-pixels

Slice rectangle from pixels array

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
clip-pixels
301.0.14 years ago4 years agoMinified + gzip package size for clip-pixels in KB

Readme

Build Status Slice rectangle from an array with pixels.

clip(arr, shape=[w, h?, channels=4], rect=[x, y?, w?, h?])

```js var clip = require('clip-pixels') var pixels = 0, 1, 0, 1, 1, 1, 0, 1, 0 pixels = clip(pixels, 3, 3, 1, 1, 0, 2, 3) / 1, 0, 1, 1, 1, 0 / ```