Installations
npm install imagemin-optipng
Developer
imagemin
Developer Guide
Module System
Unable to determine the module system for this package.
Min. Node Version
>=10
Typescript Support
No
Node Version
12.16.1
NPM Version
6.14.4
Statistics
164 Stars
79 Commits
36 Forks
9 Watching
1 Branches
8 Contributors
Updated on 20 Nov 2024
Bundle Size
69.57 kB
Minified
23.30 kB
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
209,496,000
Last day
-12%
96,873
Compared to previous day
Last week
-6.8%
503,657
Compared to previous week
Last month
8.1%
2,221,574
Compared to previous month
Last year
-21.3%
26,521,350
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
imagemin-optipng
Imagemin plugin for OptiPNG
Install
$ npm install imagemin-optipng
Usage
1const imagemin = require('imagemin'); 2const imageminOptipng = require('imagemin-optipng'); 3 4(async () => { 5 await imagemin(['images/*.png'], { 6 destination: 'build/images', 7 plugins: [ 8 imageminOptipng() 9 ] 10 }); 11 12 console.log('Images optimized!'); 13})();
API
imageminOptipng(options?)(buffer)
Returns a Promise<Buffer>
.
options
Type: object
optimizationLevel
Type: number
Default: 3
Select an optimization level between 0
and 7
.
The optimization level 0 enables a set of optimization operations that require minimal effort. There will be no changes to image attributes like bit depth or color type, and no recompression of existing IDAT datastreams. The optimization level 1 enables a single IDAT compression trial. The trial chosen is what. OptiPNG thinks it’s probably the most effective. The optimization levels 2 and higher enable multiple IDAT compression trials; the higher the level, the more trials.
Level and trials:
- 1 trial
- 8 trials
- 16 trials
- 24 trials
- 48 trials
- 120 trials
- 240 trials
bitDepthReduction
Type: boolean
Default: true
Apply bit depth reduction.
colorTypeReduction
Type: boolean
Default: true
Apply color type reduction.
paletteReduction
Type: boolean
Default: true
Apply palette reduction.
interlaced
Type: boolean | undefined | null
Default: false
Enable Adam7 PNG interlacing on any images that are processed. Interlaced images look better when they're loaded partially, but usually interlace makes compression less efficient. Set to undefined
or null
to keep the same interlacing as the input image.
errorRecovery
Type: boolean
Default: true
A reasonable amount of effort will be spent to try to recover as much data as possible of a broken image, but the success cannot generally be guaranteed.
buffer
Type: Buffer
Buffer to optimize.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/imagemin/imagemin-optipng/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/imagemin/imagemin-optipng/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/imagemin/imagemin-optipng/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/imagemin/imagemin-optipng/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/imagemin/imagemin-optipng/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/imagemin/imagemin-optipng/test.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:26
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:44
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 8 are checked with a SAST tool
Score
3.5
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More