Published Jan 20 2023
One tool Iโve been using to optimize images is sharp.
import sharp from 'sharp'
Hereโs how I used it to convert images to webp:
await sharp('image.png')
.webp({ lossless: true })
.toFile('image.webp')
It can do a lot more image processing stuff like rotate resize etc.
I wrote an entire book on this topic ๐
© 2023 Flavio Copes
using
Notion to Site.
Follow on Twitter
Solopreneur? Wannabe? Adventure awaits