pnm

PNM library for Crystal Lang

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
Repository

pnm

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • about 7 years ago
  • February 17, 2017
License

MIT License

Links
Synced at

Fri, 03 May 2024 04:11:54 GMT

Languages