Skip to content

Web viewer and converter for Netpbm files: .pbm, .pgm, .ppm (P1 - P6)

License

Notifications You must be signed in to change notification settings

cs101course/Netpbm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netpbm

Web viewer and converter for Netpbm files: .pbm, .pgm, .ppm (P1 - P6)

PPM Converter (Web)

import { PpmImage } from "@cs101/ppm-converter";

const imageConverter = new PpmImage(data); // data = byte string

imageConverter.getCanvas() // returns a canvas displaying the PPM file
imageConverter.getPNG()    // returns a b64 DataURI of a PNG

PPM Converter (NodeJS/Sharp)

import { PpmImage } from "@cs101/ppm-converter-sharp";

const imageConverter = new PpmImage(data); // data = Uint8Array

const image = imageConverter.getImage() // returns a sharp image

await image.toFile("image.png");

Credits:

Inspiration taken from:

About

Web viewer and converter for Netpbm files: .pbm, .pgm, .ppm (P1 - P6)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published