gen-jsbmp
a javascript lib to generate different depth of bmp image
how to use
install
npm i -S gen-jsbmp
commonjs
const jsbmp =
in browser
es2015
import jsbmp from 'gen-jsbmp'
API
var bmp_base64 = jsmap(canvas, depth)
- canvas: The original picture container
- depth: The depth of bmp image, can be one of 1,2,4,8,16,24,32. Default to be 1.
example
var depthArr = 1 2 4 8 16 24 32var canvas = documentvar img = imgsrc = 'test.png'img {canvaswidth = imgwidth canvasheight = imgheightvar ctx = canvasctxdepthArr}