1.1.3
zero-dependency JavaScript image manipulation
Attributes
Extremely Popular
Repository
Current version released
4 years ago
ImageScript
zero-dependency JavaScript image manipulation
ImageScript is a zero-dependency alternative to common JavaScript bitmap image manipulation tools. It can achieve much more performant results by utilizing lower-level memory access, less memory copying and WebAssembly for compression and encoding.
Example
const fs = require('fs').promises;
const {Image} = require('imagescript');
(async () => {
const image = await Image.decode(await fs.readFile('./photo.png'));
const overlay = await Image.decode(await fs.readFile('./overlay.png'));
image.crop(228, 20, 152, 171);
overlay.resize(image.width, Image.RESIZE_AUTO);
overlay.opacity(0.8, true);
image.composite(overlay, 0, image.height - overlay.height);
await fs.writeFile('./output.png', await image.encode());
})();
Inputs
Output
If you have any additional questions, feel free to join the discord support server.