Build low quality images.
Create low quality images to improve the load time of your page, and fetch the real images asynchronously. You can do that with the help of lowly and progressively.
This project uses node and npm. Go check them out if you don't have them locally installed.
$ npm install lowly
const fs = require('fs')
const lowly = require('lowly')
const image = fs.readFileSync('image.jpg')
lowly(image)
.then(buff => {
fs.writeFileSync('image-lowly.jpg', buff)
})
$ lowly --help
Usage
$ lowly <input>
Examples
$ lowly image.jpg
$ lowly images/**/* image.jpg
Resize a image preserving the aspect ratio.
Parameters
image
Buffer the buffer of a image return by fs.readFile.
Returns Promise that resolves a buffer of the image with low quality.