I am trying to round corners on an image using nodejs to process the images. I feel like the best library to do this would be gm but since I cannot use gm I have to use the imagick adapter as such
var gm = gm.subClass({ imageMagick: true });
gm("img.jpg").autoOrient().resize(50, 50).write('/path', callback);
From here I cannot figure out how to get rounded corners. I do not want to do this in css since it is for a mobile app and client size it makes lags. Edges must be smooth.
imagemagick.convert([
"-size", width + "x" + height,
"xc:none",
"-fill", dest,
"-draw",
"circle " + (width / 2) + "," + (width / 2) + " " + (width / 2) + ",1",
dest
], function(err) {
return done(err);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With