node-poster-gm
v0.0.1
Published
基于gm的node绘图
Downloads
1
Readme
前端node工具集
Getting started
First download and install GraphicsMagick or ImageMagick. In Mac OS X, you can simply use Homebrew and do:
brew install imagemagick
brew install graphicsmagick
If you want WebP support with ImageMagick, you must add the WebP option:
brew install imagemagick --with-webp
then either use npm:
npm install gm
useing
const Poster = require('node-poster-browser')
let poster
async function getPoster() {
if(!poster) {
poster = await Poster({
CACHE_DIR: './cache2/'
})
}
return poster
}
async function main() {
let p = await getPoster()
p.createPoster()
}
main()
Use ImageMagick instead of gm
Subclass gm
to enable ImageMagick
var fs = require('fs')
, gm = require('gm').subClass({imageMagick: true});
// resize and remove EXIF profile data
gm('/path/to/my/img.jpg')
.resize(240, 240)
...