Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

writepng

1.0.1 • Public • Published

writepng

NPM

Take an image in the format output by http://npm.im/readimage and write it to a png.

NOTE: This library does not currently support APNG (animated pngs). If the image has multiple frames, only the first will be saved.

var readimage = require("readimage")
var writepng = require("writepng")
var fs = require("fs")
 
readimage(fs.readFileSync("./image.jpg"), function (err, image) {
  writepng(image, function (err, buffer) {
    fs.writeFileSync("./image.png", buffer)
  })
})
 

More examples are in the examples/ folder!

API

require("writepng")(imageBuffer, callback)

Write a buffer that represents a png image generated from the imageBuffer.

require("writepng")(imageBuffer, options, callback)

The same as above, but options can be defined to match those in pngjs


LICENSE
=======

MIT

install

npm i writepng

Downloadsweekly downloads

2

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability