use gm to compress pictures, the picture quality is very poor, how to solve?
as shown in the figure, 1.png is before compression and 2.png is after compression. The quality is poor.
const gm = require("gm").subClass({imageMagick: true});
gm("/Users/jiang/Downloads/1.png")
.resize(318, 211)
.noProfile()
.write("/Users/jiang/Downloads/2.png", function (err, data) {
if (err) {
throw err;
}
});
this is the code