use jimp to resize images.
npm install --save imagemin-jimp
const jimpOptions = {
width: 2000, // default max width
height: 1000, // default max height
grow: false, // pass true to make images larger than they are
}
imagemin(input, output, {
plugins: [
imageminJimp(jimpOptions),
],
})