Crops an n-dimensional image in place.
Via npm:
npm install ndcrop
In node, evaluating:
require("ndcrop")([2,2], [[1, 0, 0, 0],
[0, 0, 0, 0]]);
Prints:
[ [ 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 dimensionsimagethe image to resize
Returns a resized image
(c) 2013 Mikola Lysenko. BSD