The algorithm moves the center of the "window" specified by width and height to the center of the image. Every pixel outside of the window are not included in the resulting image.
The resulting image has the width and height given in width and height parameters.
Output of the function
An image cropped to the width and height
If there are metadata in the input image, e.g. EXIF data, these are also included in the resulting image
Prerequisits
the algorithm should be self contained
If other npm packages are used to implement it, they have to be open source
Input parameters of the Javascript function:
Algorithm:
Output of the function
Prerequisits