
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
image-optimizer-core
Advanced tools
This Package optimizes your jpeg and png by adjusting the quality automatically
This Package optimizes your images and adjust the quality automatically. So no standard 80% Quality on your JPEG's.
please have a look at the instruction of node-opencv to install opencv on your machine.
$ npm install image-optimizer-core
# or with yarn
$ yarn add image-optimizer-core
import optimizer from 'image-optimizer-core'
// or with the old way
// const optimizer = require('image-optimizer-core')
// using files
optimizer('path/to/file.jpg')
.toFile('output.jpg')
.then(saved => {
console.log('I saved you', saved * 100, '%')
})
// using Buffer
optimizer(buffer)
.toBuffer()
.then(output => {
// ...
})
// You even get the saved kb back as a percentage
optimizer('example.jpg')
.toBuffer()
.then((buffer, saved) => {
console.log('saved', saved, '%') // 0.72345 ... so it saved you 72.345%
})
// or if you want, you can even convert your files
optimizer('example.png')
.toBuffer('image/webp')
.then((buffer, saved) => {
console.log('saved', saved, '%') // 0.72345 ... so it saved you 72.345%
})
Returns toBuffer and toFile
Type: Buffer or String
Returns Promise<Buffer>, <saved>
Returns Promise<saved>
Type: String
Type: Float
This is the Percentage that this lib safed you in a number between 0-1
Type: String
can be image/jpeg & image/png & image/webp .
but be aware, we dont support JPEG => PNG
if you want to have a webpack loader for it, that uses this package then go to image-optimizer-webpack-loader.
FAQs
This Package optimizes your jpeg and png by adjusting the quality automatically
We found that image-optimizer-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.