This is a basic Crystal library to parse PPM, PGM and PBM files, to make handling them easier. It's still in development.
Add this to your application's shard.yml
:
dependencies:
pnm:
github: givralix/pnm
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)
TODO: Write development instructions here
- Fork it ( https://github.com/givralix/pnm/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- givralix Givralix - creator, maintainer