wasm-vips is a browser/node wrapper for libvips
Goals:
Using wasm-vips
Example reading an image
const vips = await Vips();
let im = vips.Image.newFromFile('in.jpg');
But I do not know the function and properties I need to use to resample my image to 2017x2017
It looks like I need to use vips.affine as shown in the vips docs. https://www.libvips.org/API/current/libvips-resample.html#vips-affine
The wasm-vips has the affine method im.affine()
but I don't know how to specify the interpolater such as lanzcos3. I also want to pass in a uint8array instead of reading an image from a file directly.
Thanks, Dan
I would guess:
im.resize(2017 / im.width, {kernel: 'lanczos3'})
And I'd look at newFromMemory
to read from a uint8 array. Ask on the wasm-vips issue tracker:
https://github.com/kleisauke/wasm-vips
(was a comment, made into an answer on request)