node利用canvas处理图像,返回给前端,
1.安装 canvasnpm i canvas -s2.引入const { createCanvas, loadImage } = require('canvas');const canvas = createCanvas(width, height);const context = canvas.getContext('2d')3.处理//这里是因为传入多个坐标,所以进行了循环//imag 要加载的图片,0,0,分别代表x,坐标,后两个参数分别代表宽度和高度context.drawI