- Consider a image file .png
- Consider you have the xy-cords of some element like x:400, y:500
- Consider you have the size of image to be cropped: width: 50, height: 20
I have below snippet from nodejs pack easyimage and I have installed ImageMagick too. When I run below code, it just passes but unable to crop image.
easyimage.crop(
{
src: "F:/screenshot.png", // Contains fullscreen image
dst: "F:/screenshot.png", // New image with cropped name
x: 400,
y: 500,
cropwidth: 50,
cropheight: 20,
gravity: "North-West",
},
(err, stdout, stderr) => {
if (err) throw err
}
)