README.md
# netpbm
Render PBM and PGM images in Gleam
[](https://hex.pm/packages/netpbm)
[](https://hexdocs.pm/netpbm/)
```sh
gleam add netpbm@2
```
```gleam
import netpbm
import simplifile
pub fn main() -> Nil {
let pgm =
netpbm.simple_render_pgm(width: 510, height: 255, pixel: fn(x, y) {
// Render a gradiant from top-left to bottom-right
{ x / 2 + y } / 2
})
let assert Ok(_) = simplifile.write_bits("out2.pgm", pgm)
}
```
Further documentation can be found at <https://hexdocs.pm/netpbm>.