Skip to content

Givralix/pnm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pnm

This is a basic Crystal library to parse PPM, PGM and PBM files, to make handling them easier. It's still in development.

Installation

Add this to your application's shard.yml:

dependencies:
  pnm:
    github: givralix/pnm

Usage

require "pnm"

Return the file's data type:

data = File.read(filename).bytes
PNM.datatype?(data)

Create a PPM object from an existing file:

picture = PNM::PPM.new(data)

Create a PPM object from scratch:

picture = PNM::PPM.new(width, height, maxval, data)

Write the picture to a file:

picture.write(filename)

Development

TODO: Write development instructions here

Contributing

  1. Fork it ( https://github.com/givralix/pnm/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • givralix Givralix - creator, maintainer

About

PNM library for Crystal Lang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published