2.3.0 • Published 10 months ago

lodepng v2.3.0

Weekly downloads
282
License
Zlib
Repository
github
Last release
10 months ago

LodePNG Node.js bindings

Bindings for LodePNG which decodes and encodes PNG images.

Installation

npm install --save lodepng

Usage

const fs = require('fs')
const png = require('lodepng')

/** Decoding **/

const src = fs.readFileSync('test.png')

png.decode(src).then((res) => {
  console.log(`Image size: ${res.width}x${res.height}`)
  // res.data is a Buffer with RGBA data
})

/** Encoding **/

const data = fs.readFileSync('test.raw')

png.encode({ width: 16, height: 16, data }).then((res) => {
  // res is a Buffer with PNG data
})

API

png.decode(source) => Promise

Decode PNG data to raw RGBA buffer.

png.encode(source) => Promise

Encode raw RGBA buffer to PNG data.

2.3.0

10 months ago

2.2.0

2 years ago

2.1.0

4 years ago

2.0.0

6 years ago

1.3.0

6 years ago

1.2.0

7 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.2.3

8 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago