Gathering detailed insights and metrics for pngparse-2
Gathering detailed insights and metrics for pngparse-2
Gathering detailed insights and metrics for pngparse-2
Gathering detailed insights and metrics for pngparse-2
npm install pngparse-2
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
78 Stars
46 Commits
13 Forks
3 Watchers
1 Branches
2 Contributors
Updated on Jun 18, 2023
Latest Version
2.0.1
Package Id
pngparse-2@2.0.1
Size
316.60 kB
NPM Version
3.10.10
Node Version
6.11.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
pngparse
is a pure-JavaScript library for Node.JS for
converting a PNG file into an array of pixel values. It came out of a need for
reading PNG images in Node.JS for the Dark Sky
API, but all existing libraries either had
compilation issues or did not support enough of the PNG standard to be
practical.
There's a reason nobody writes PNG-parsing libraries. This stuff is complicated and reinventing the wheel is dumb. But, if you're wondering whether you can trust it, it has a full unit test suite and we've been using it in production since Sep 2012, so there you go.
It's reasonably complete, covering most PNG color types, depths, and filters; notable omissions are lack of support for 16-bit images and interlacing.
Comments, bug fixes, feature improvements, etc. are all welcome. If you do write code, please ensure that you write tests for it!
To install:
npm install pngparse
To use:
var pngparse = require("pngparse")
...
pngparse.parse(buffer, function(err, data) {
if(err)
throw err
/* do things! */
})
...
pngparse.parseFile("path/to/file.png", function(err, data) {
if(err)
throw err
/* do things! */
})
The data
object returned from the callback bears a striking resemblance to
the HTML5 Canvas ImageData
object. A notable
distinction is that the object returns has a channels
property which
indicates how many color channels it uses (while an HTML5 ImageData object is
always 4-channel). The possible color channel combinations are as follows:
1 channel : grayscale
2 channels: grayscale + alpha
3 channels: RGB
4 channels: RGBA
If you use the ImageData.prototype.getPixel
method, this is handled for you;
however, if you access the data
array manually, then you will have to be
aware of it.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 2/29 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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