Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

clip-pixels

dy16.2kMIT1.0.1

Slice rectangle from pixels array

clip, slice, ndarray, flip-pixels, pxls, pixels

readme

Build Status

Slice rectangle from an array with pixels.

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

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
*/