Skip to content

A simple package to convert png files to pgm files.

Notifications You must be signed in to change notification settings

e-compton/pngToPgm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PNG to PGM

A simple library that convert PNG files to PGM files.

Installation

npm install pngtopgm

Basic Usage

The module exposes a single function that takes a buffer as the argument. It returns a buffer containing the PGM file data in ASCII format.

pngToPgm(buffer)
const pngToPgm = require('pngtopgm');
const fs = require('fs');

let myPng = fs.readFileSync('./myPng.png');
let myPgm = pgnToPgm(myPng);
fs.writeFileSync('./myPgm.pgm', myPgm);

Development

Run unit tests and linting with:

npm run test
npm run lint

About

A simple package to convert png files to pgm files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published