tinify 这个我看网上都说一个月只能压缩500次,超出要收费
有没有开源的压缩图片的 node包呢
imagemin 啊。npm 直接搜就有了。
最常见的图片压缩库了,有相应的 gulp / grunt / webpack 插件。
webpack 自带的 image-loader 也依赖于此库。
The typical use case for this high speed Node.js module is to convert large images in common formats to smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.Resizing an image is typically 4x-5x faster than using the quickest ImageMagick and GraphicsMagick settings due to its use oflibvips.
Colour spaces, embedded ICC profiles and alpha transparency channels are all handled correctly. Lanczos resampling ensures quality is not sacrificed for speed.
As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available.
Most modern macOS, Windows and Linux systems running Node.js v10+ do not require any additional install or runtime dependencies.
5 回答4.9k 阅读✓ 已解决
4 回答2.5k 阅读✓ 已解决
2 回答1.8k 阅读✓ 已解决
5 回答2k 阅读
3 回答2.1k 阅读
1 回答3.3k 阅读
1 回答2.8k 阅读
我觉得还是看需求吧。首先我们使用 sharp 安装没遇到什么问题;其次我建议先试试 webp。