{"_id":"png-js","_rev":"17-f44fece1e1867ae30e618fb3267650a2","name":"png-js","dist-tags":{"latest":"3.0.0"},"versions":{"0.1.0":{"name":"png-js","version":"0.1.0","author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"_id":"png-js@0.1.0","maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"}],"bugs":{"name":"http://github.com/devongovett/png.js/issues"},"dist":{"shasum":"f419b6986e0fea35ca05f0f461926870f9e37db6","tarball":"https://registry.npmjs.org/png-js/-/png-js-0.1.0.tgz","integrity":"sha512-wNwtUkSipoEcfrUay0xKQAWA/LAmjuhcdkkU+hmxG/No3cjWJrXCCw48WiSwcthCD6glogNnxZdU/FkR71A3mw==","signatures":[{"sig":"MEUCIQDfaJeLMcpUBRA2Yzkv2qZWqcSz9PHvPtgOueRvxJqrNgIgWUhwZwT3M38yWCf6Ews8GD/fdsmBiGN7BMt8EIDgth0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"png-node.js","engine":["node >= v0.6.0"],"engines":{"node":"*"},"scripts":{"prepublish":"coffee -c png-node.coffee"},"_npmUser":{"name":"devongovett","email":"devongovett@gmail.com"},"repository":{"url":"git://github.com/devongovett/png.js.git","type":"git"},"_npmVersion":"1.1.0-3","description":"A PNG decoder in CoffeeScript","directories":{},"_nodeVersion":"v0.6.9","dependencies":{},"_defaultsLoaded":true,"devDependencies":{"coffee-script":">=1.0.1"},"_engineSupported":true,"optionalDependencies":{}},"0.1.1":{"name":"png-js","version":"0.1.1","author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"_id":"png-js@0.1.1","maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"}],"bugs":"http://github.com/devongovett/png.js/issues","dist":{"shasum":"1cc7c212303acabe74263ec3ac78009580242d93","tarball":"https://registry.npmjs.org/png-js/-/png-js-0.1.1.tgz","integrity":"sha512-NTtk2SyfjBm+xYl2/VZJBhFnTQ4kU5qWC7VC4/iGbrgiU4FuB4xC+74erxADYJIqZICOR1HCvRA7EBHkpjTg9g==","signatures":[{"sig":"MEUCIQDtL1rgdVaUioTjApWiK6/wkNbNO5BIIR8DiB69O+/p2gIgCfw0SZrb/SsByFzXsdAi5hjcYphm529r79FfDmpGsZI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"png-node.js","engine":["node >= v0.6.0"],"scripts":{"prepublish":"coffee -c png-node.coffee"},"repository":{"url":"https://github.com/devongovett/png.js.git","type":"git"},"description":"A PNG decoder in CoffeeScript","directories":{},"devDependencies":{"coffee-script":">=1.0.1"}},"1.0.0":{"name":"png-js","version":"1.0.0","author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"_id":"png-js@1.0.0","maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"}],"homepage":"https://github.com/devongovett/png.js#readme","bugs":{"url":"http://github.com/devongovett/png.js/issues"},"dist":{"shasum":"e5484f1e8156996e383aceebb3789fd75df1874d","tarball":"https://registry.npmjs.org/png-js/-/png-js-1.0.0.tgz","fileCount":44,"integrity":"sha512-k+YsbhpA9e+EFfKjTCH3VW6aoKlyNYI6NYdTfDL4CIvFnvsuO84ttonmZE7rc+v23SLTH8XX+5w/Ak9v0xGY4g==","signatures":[{"sig":"MEUCIE9e4OS/Hbd19738miXIgPYrzLR4CNVN225PtDWowLkTAiEAhMhB9hjnjtmEemwDtPHoRdLyoZ0ssUodta1cxtvTVS0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3114151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0L2fCRA9TVsSAnZWagAAJ2EP/iCmK9X2PniRdmTIKbi6\nafUvPZ1bpbnFu4vWIGxiLmIpBUXE0rXuj52EBPGu1FegwhX9gD7OmljUKLEW\njxcwCLUBKUvmX4zjoL3o9Id52U8jzlO7mMiHMOIWKVlXEmuDk6gjF9qKYVaw\nkrfMhaDOAYFT1xo0tBfq8Pt/3+XfNifZPJGdc3qSIqiDdtkBfH7H0PeU9Naa\ndojCisWbo3zabRIeDchW+05cWFJzmgiPiUcr0XwtC66taC4haDvAt2OTqGZb\nngwtieH/7QyD/rptdGpv/eUIZFxpqee3jQsXHu04tFbDZkl38w09G9qlqhxS\nF0i1Ti/7Wl0kuWq7OtCwl6tzCvfTKLhp9mSiL2Ppu01Fh6uzehGhcefvQt2a\nkvqnOD/lnKDmy2NcwaswGKanXMKWh4RTQ+eobULjReL/7Ob0vpltIe2WYry4\nIpsMW/QZh9SZj4xqb5H1KpzmRGgMyqXLndx2o4gzD9AfWohbnIsHnKR70TEt\n2JJ3JC+dWoS3yBH97Uadhl+CnzXhFW/+b56Z3j5XTLt+no4JPlAxYO2GDqnb\nvbE6bCrc0sRDTEXldKduZNMr+4vkaKi9LresH4koROwuPyy6lFHzky7DUx0p\nCK2aqczYvuQ7MCOdqFmvTN1EYJpXI7rIz+KCVjTxqudVfOzgjHiOX76bpp2Z\nAILq\r\n=5cBI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"setupFiles":["<rootDir>/test/patch-canvas.js","<rootDir>/zlib.js","<rootDir>/png.js"]},"main":"png-node.js","engine":["node >= v0.6.0"],"gitHead":"977b857a11676c1e720e79ed8d9178a005a9abd6","scripts":{"test":"jest","prettier":"prettier test/**/*.js png-node.js png.js --write"},"_npmUser":{"name":"devongovett","email":"devongovett@gmail.com"},"repository":{"url":"git+https://github.com/devongovett/png.js.git","type":"git"},"_npmVersion":"6.10.3","description":"A PNG decoder in JavaScript","directories":{},"_nodeVersion":"12.10.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^24.1.0","prettier":"^1.16.4"},"_npmOperationalInternal":{"tmp":"tmp/png-js_1.0.0_1573961118929_0.47878634567628975","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"png-js","version":"1.1.0","author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"_id":"png-js@1.1.0","maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"homepage":"https://github.com/devongovett/png.js#readme","bugs":{"url":"http://github.com/devongovett/png.js/issues"},"dist":{"shasum":"60a135216601f807b88a6d61ac93bd42a32c5ee1","tarball":"https://registry.npmjs.org/png-js/-/png-js-1.1.0.tgz","fileCount":8,"integrity":"sha512-PM/uYGzGdNSzqeOgly68+6wKQDL1SY0a/N+OEa/+br6LnHWOAJB0Npiamnodfq3jd2LS/i2fMeOKSAILjA+m5Q==","signatures":[{"sig":"MEQCIANT2fOdk+un+4DrfNZS/UIPFCqV6vr28RriePK4NJydAiB7T4rdLaXIDz/SYpm8NX3snV3W2lCds/p94RKz5Gcz8Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66069},"jest":{"setupFiles":["<rootDir>/test/patch-canvas.js","<rootDir>/zlib.js","<rootDir>/png.js"]},"main":"./lib/png-js.cjs","type":"module","engine":["node >= v0.6.0"],"module":"./lib/png-js.js","browser":{"./lib/png-js.js":"./lib/png-js.browser.js","./lib/png-js.cjs":"./lib/png-js.browser.cjs"},"exports":{".":{"node":{"import":"./lib/png-js.js","require":"./lib/png-js.cjs"},"import":"./lib/png-js.browser.js","require":"./lib/png-js.browser.cjs"}},"gitHead":"fe53c2d25545e941a6f706cba30ed13c0991d1a1","scripts":{"test":"yarn build && jest","build":"rimraf ./lib && rollup -c","prettier":"prettier test/**/*.js png-node.js png.js --write"},"_npmUser":{"name":"diegomura","email":"diegomuracciole@gmail.com"},"repository":{"url":"git+https://github.com/devongovett/png.js.git","type":"git"},"_npmVersion":"10.7.0","description":"A PNG decoder in JavaScript","directories":{},"_nodeVersion":"18.20.4","dependencies":{"browserify-zlib":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"24.1.0","rimraf":"2.6.3","rollup":"4.9.0","prettier":"1.16.4","@rollup/plugin-alias":"5.1.0","rollup-plugin-ignore":"1.0.10","@rollup/plugin-replace":"5.0.0","@rollup/plugin-node-resolve":"15.2.0"},"_npmOperationalInternal":{"tmp":"tmp/png-js_1.1.0_1776193470506_0.3279486847494415","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"png-js","version":"2.0.0","author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"_id":"png-js@2.0.0","maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"homepage":"https://github.com/devongovett/png.js#readme","bugs":{"url":"http://github.com/devongovett/png.js/issues"},"dist":{"shasum":"7bc521aea1d47f5e3bf42eeecdd77095cba98d5f","tarball":"https://registry.npmjs.org/png-js/-/png-js-2.0.0.tgz","fileCount":8,"integrity":"sha512-GdzJuUMc6ZSpxFJWVxtOH1bzYHym+TOnveqUjb+VJIbZWbZzyiRGFiKhbiielfpYbgMlhHVhsJ0FTazfuRFkMA==","signatures":[{"sig":"MEUCIEFUfEwndJ+TonCP1LcX3pfy177hRppwvIXam5y1JVqZAiEA3E3zTD6440Z8tOFeeDU08hrK+MXFHM2bqMu6a/QyZN4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65921},"jest":{"setupFiles":["<rootDir>/test/patch-canvas.js","<rootDir>/zlib.js","<rootDir>/png.js"]},"main":"./lib/png-js.cjs","type":"module","engine":["node >= v0.6.0"],"module":"./lib/png-js.js","browser":{"./lib/png-js.js":"./lib/png-js.browser.js","./lib/png-js.cjs":"./lib/png-js.browser.cjs"},"exports":{".":{"node":{"import":"./lib/png-js.js","require":"./lib/png-js.cjs"},"import":"./lib/png-js.browser.js","require":"./lib/png-js.browser.cjs"}},"gitHead":"ce0b0138a95b1dd6557f518c7a8dea2ff4fa3694","scripts":{"test":"yarn build && jest","build":"rimraf ./lib && rollup -c","prettier":"prettier test/**/*.js png-node.js png.js --write"},"_npmUser":{"name":"diegomura","email":"diegomuracciole@gmail.com"},"repository":{"url":"git+https://github.com/devongovett/png.js.git","type":"git"},"_npmVersion":"10.9.2","description":"A PNG decoder in JavaScript","directories":{},"_nodeVersion":"22.15.0","dependencies":{"fflate":"^0.8.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"24.1.0","rimraf":"2.6.3","rollup":"4.9.0","prettier":"1.16.4","rollup-plugin-ignore":"1.0.10","@rollup/plugin-replace":"5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/png-js_2.0.0_1776209903799_0.9733123096370431","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"_id":"png-js@3.0.0","bugs":{"url":"http://github.com/devongovett/png.js/issues"},"dist":{"shasum":"a04d18d1492d49efae40447ef41aa572cdaa0d88","tarball":"https://registry.npmjs.org/png-js/-/png-js-3.0.0.tgz","fileCount":8,"integrity":"sha512-4cXXV2NPgaYdSpa/HrA3bdB9/eJrJppUW2kCYpQkmWOY9/J0B2tKa0EsDymImaDZidoV7hnp8Qx6W6vqodDXwg==","signatures":[{"sig":"MEQCIHjTcNQ7yVHZ4ioGwHshE4JuP6RXBs673yUz+A4vS81hAiAgms9X6zPQoOYKTGw64zl48LjiLSkyj1kOC0pB+OjzSQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCREUwQF9KQmFEIqz/n/d/kzUxBfVGh0LC9UclYlg5wIwIhALh8ug/rHIFKPlYNH92QhPleO6Fysx9VKdslxR9+Zjtl"}],"unpackedSize":84363},"main":"./lib/png-js.cjs","name":"png-js","type":"module","author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"module":"./lib/png-js.js","browser":{"./lib/png-js.js":"./lib/png-js.browser.js","./lib/png-js.cjs":"./lib/png-js.browser.cjs"},"engines":{"node":">=18"},"exports":{".":{"node":{"import":"./lib/png-js.js","require":"./lib/png-js.cjs"},"import":"./lib/png-js.browser.js","require":"./lib/png-js.browser.cjs"}},"gitHead":"e4feffa60ba5e3005e18d89dfba1fc3155b8d419","license":"MIT","scripts":{"test":"yarn build && vitest run","bench":"yarn build && node bench/cpu.js","build":"rimraf ./lib && rollup -c","format":"prettier --write test/**/*.js png.js","prepack":"yarn build","bench:mem":"yarn build && node --expose-gc bench/memory.js","format:check":"prettier --check test/**/*.js png.js","bench:fixtures":"node bench/generate-fixtures.js"},"version":"3.0.0","_npmUser":{"name":"blikblum-dev","email":"camara_luiz@yahoo.com.br"},"homepage":"https://github.com/devongovett/png.js#readme","repository":{"url":"git+https://github.com/devongovett/png.js.git","type":"git"},"_npmVersion":"11.6.2","description":"A PNG decoder in JavaScript","directories":{},"maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"diegomura","email":"diegomuracciole@gmail.com"},{"name":"blikblum-dev","email":"camara_luiz@yahoo.com.br"}],"_nodeVersion":"24.12.0","dependencies":{"fflate":"^0.8.3"},"_hasShrinkwrap":false,"packageManager":"yarn@4.18.1","devDependencies":{"vite":"8.3.5","jsdom":"30.1.3","rimraf":"6.1.3","rollup":"4.65.0","vitest":"5.0.5","prettier":"3.9.10","rollup-plugin-ignore":"1.0.10","@rollup/plugin-replace":"6.0.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/png-js_3.0.0_1794439795792_0.9903525235443659"}}},"time":{"created":"2012-04-07T04:42:44.455Z","modified":"2026-11-11T23:29:56.056Z","0.1.0":"2012-04-07T04:42:45.730Z","0.1.1":"2012-11-21T23:17:13.830Z","1.0.0":"2019-11-17T03:25:19.490Z","1.1.0":"2026-04-14T19:04:30.672Z","2.0.0":"2026-04-14T23:38:23.950Z","3.0.0":"2026-11-11T23:29:55.868Z"},"bugs":{"url":"http://github.com/devongovett/png.js/issues"},"author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"homepage":"https://github.com/devongovett/png.js#readme","repository":{"url":"git+https://github.com/devongovett/png.js.git","type":"git"},"description":"A PNG decoder in JavaScript","maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"diegomura","email":"diegomuracciole@gmail.com"},{"name":"blikblum-dev","email":"camara_luiz@yahoo.com.br"}],"readme":"# png.js\n\nA PNG decoder in JS for the canvas element or Node.js.\n\n## Browser Usage\n\nInclude png.js and zlib.js on your HTML page, create a canvas element, and call\n`PNG.load` to load and render an image. It returns a Promise resolving to the\nPNG instance after rendering; omit the canvas to load without rendering.\n\n    <canvas></canvas>\n    <script src=\"zlib.js\"></script>\n    <script src=\"png.js\"></script>\n    <script type=\"module\">\n        try {\n            const canvas = document.getElementsByTagName('canvas')[0];\n            const png = await window.PNG.load('some.png', canvas);\n            console.log('Loaded PNG:', png.width, png.height);\n        } catch (err) {\n            console.error('Could not load PNG:', err);\n        }\n    </script>\n\nThe standalone browser version resides in `png.js`, exposes `window.PNG`, and\nalso supports loading and displaying animated PNGs. Its `PNG.load` rejects on non-2xx HTTP responses,\nnetwork errors, aborted requests, and parsing or rendering errors. Serve the\npage over HTTP; local-file requests with status 0 are rejected.\n\n## Node.js Usage\n\nInstall the module using npm\n\n    sudo npm install png-js\n\nImport the module and decode a PNG. Run this example as an ES module, for\nexample in an `.mjs` file or in a package with `\"type\": \"module\"`.\n\n    import PNG from 'png-js';\n\n    try {\n        const pixels = await PNG.decode('some.png');\n        // pixels is a 1d Uint8Array in RGBA order\n    } catch (err) {\n        console.error('Could not decode PNG:', err);\n    }\n\nThe packaged asynchronous methods `PNG.decode(path)`, `png.decode()`, and\n`png.decodePixels()` return Promises. The first two resolve to RGBA pixel\ndata as a `Uint8Array`; `decodePixels()` resolves to raw pixel data before\nRGBA conversion. They reject on errors, including file-read failures such as\n`ENOENT`, invalid PNG data, and decompression failures. The packaged browser\nbuild supports instance decoding but rejects `PNG.decode(path)`.\n\nYou can also call `PNG.load` if you want to load the PNG (but not decode the pixels) synchronously. If you already\nhave the PNG data in a buffer, simply use `new PNG(buffer)`. In both of these cases, you need to call `png.decode`\nyourself and await the decoded RGBA pixels. This synchronous Node.js\n`PNG.load` is distinct from the standalone browser's asynchronous `PNG.load`.\nIf you already have a buffer you want the pixels copied to, call\n`copyToImageData` with your buffer and the raw pixels resolved by\n`decodePixels()`.\n\nFor synchronous pixel decoding, call `decodePixelsSync` on a PNG instance. It returns a `Uint8Array` containing the\ndecoded pixel data before conversion to RGBA.\n\n    var png = new PNG(buffer);\n    var pixels = png.decodePixelsSync();\n\n## Performance\n\nDecoding runs in a fixed number of passes with no per-byte allocation: the\ncompressed `IDAT` stream is concatenated exactly once, inflated without an\nextra input copy on Node (the browser build makes one copy because fflate's\nasync `unzlib` detaches its input), and unfiltered scanline by scanline —\ninterlaced (Adam7) images reuse a two-scanline ring buffer instead of\nper-pass scratch allocations.\n\nSee [`bench/README.md`](bench/README.md) for the benchmark suite and how to\ncompare two checkouts with the same harness.\n","readmeFilename":"README.md","users":{"bonez":true,"heineiuo":true},"license":"MIT"}