dwebp-bin将WebP解码为PNG的dwebp node.js包装器
dwebp-bin是一种现代图像格式,可为网络上的图像提供卓越的无损和有损压缩。使用WebP,网站管理员和Web开发人员可以创建更小、更丰富的图像,从而提高Web速度。安装$ npm install dwebp-bin WebP在Linux上需要以下库。查看。 $ sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev用法const { execFile } = require ( 'child_process' ) ; const dwebp = require ( 'dwebp-bin' ) ; execFile ( dwebp , [ 'input.webp' , '-o' , 'output.png' ] , error => { if ( error ) {
4.91MB
文件大小:
评论区