Crops an n-dimensional image in place.
npm install ndcrop
In node, evaluating:
require("ndcrop")([2,2], [[1, 0, 0, 0], [0, 0, 0, 0]]);
[ [ 1, 0 ], [ 0, 0 ] ]
Crops the image to
dims in place. This is usually faster than resizing the image, which will allocate a new copy.
dimsthe dimensions of the new image, must be less than or equal to original image dimensions
imagethe image to resize
Returns a resized image
(c) 2013 Mikola Lysenko. BSD