Image processing core module
npm install @imageproc/core
import * as imageproc from "@imageproc/core";
(async () => {
const proc = new imageproc.ImageProcessorSharp();
const sourceBuf = fs.readFileSync("image.png");
const buf = await proc.resizeAspectFit(sourceBuf, {
...
});
fs.writeFileSync("generated.png", buf);
})();
see: ImageProcessor.ts
- ImageProcessorSharp
- (Feature Support) ImageProcessorMagick