- 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've included a piece from the easyimage nodejs package, as well as ImageMagick. When I execute the code below, it simply passes, but I am unable to crop the image.
easyimage.crop({
src: 'F:/screenshot.png', //contains fullscreen image
dst: 'F:/screenshot.png', //expect for a new image with cropped name
x: 400,
y: 500,
cropwidth: 50,
cropheight:20,
gravity: 'North-West'
},
function(err, stdout, stderr) {
if (err) throw err;
});