$ npm install @jimp/plugin-scale
Scale an image.
Uniformly scales the image by a factor.
import jimp from "jimp";
async function main() {
const image = await jimp.read("test/image.png");
image.scale(2);
image.scale(2, jimp.RESIZE_BEZIER);
}
main();
Scale the image to the largest size that fits inside the rectangle that has the given width and height.
import jimp from "jimp";
async function main() {
const image = await jimp.read("test/image.png");
image.scaleToFit(100, 100);
}
main();
© 2010 - cnpmjs.org x YWFE | Home | YWFE