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
NodeJS – Resize() is an inbuilt function that is used to resize the images to the desired size. We can use resize to set the height and width using a 2-pass bilinear algorithm. It can resize an image into any size as declared by the user. We can take input from the user or resize it into fixed Width*Height size.
sharp is a popular Node. js image processing library that supports various image file formats, such as JPEG, PNG, GIF, WebP, AVIF, SVG and TIFF. In this tutorial, you'll use sharp to read an image and extract its metadata, resize, change an image format, and compress an image.
To compress your images follow these three simple steps: Install the package using npm/yarn. Add the particular code block to your project. Be Amazed!
maybe you can use imagemin
github:https://github.com/imagemin/imagemin
It can work.
I switched from gm
to https://github.com/lovell/sharp for better performance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With