Reputation: 33671
I'm looking for a node.js module.
A node.js module that I can use to serve compressed images of the sort by the smushit service.
Is there such a module?
Thanks
Upvotes: 15
Views: 55282
Reputation: 7424
Code
await sharp(file.path)
.resize(600, 600)
.toFile(file.path + '_compress')
Upvotes: 2
Reputation: 28
for compression of image compress-image package is also good option https://www.npmjs.com/package/compress-images
Upvotes: 0
Reputation: 4312
I switched from gm
to https://github.com/lovell/sharp for better performance.
Upvotes: 5
Reputation: 1750
Detected path and can use combination compressing. SVG
JPG
PNG
GIF
https://www.npmjs.com/package/compress-images
Upvotes: 1
Reputation: 430
maybe you can use imagemin
github:https://github.com/imagemin/imagemin
It can work.
Upvotes: 21
Reputation: 1391
For anyone googling this, GraphicsMagic is hosted on NPM as gm: https://www.npmjs.org/package/gm
Upvotes: 4