nimg
v1.2.2
Published
Cross-platform image decoder and encoder for Node.js
Downloads
4
Maintainers
Readme
nimg
Cross-platform image decoder and encoder for Node.js. Node.js轻量级跨平台图像编解码库
Features
- Base on CMake + node-addon-api + CImg
- 基于CMake + node-addon-api + CImg, 可靠,且易于扩展
- Easy to use
- 简单易用
Useage
class Image {
constructor()
constructor(w : number, h : number)
constructor(b : Buffer)
constructor(img : Image)
width(): number;
height(): number;
toBuffer() : Buffer; // png buffer
fill(color:string) : Image;
fill(r : number, g : number, b : number, a : number) : Image;
crop(x : number, y : number, w : number, h : number) : Image;
draw(img : Image, x : number, y : number) : Image;
resize(w : number, h : number) : Image;
rotate(degree: number) : Image;
}
Install
- install cmake
- install cmake-js
- npm install nimg