# `ExTbpMonty.Core.Png`
[🔗](https://github.com/d-led/ex.tbp.monty/blob/v0.1.0/packages/ex_tbp_monty_core/lib/ex_tbp_monty_core/png.ex#L1)

A PNG of pixels this port already has.

Monty's worlds answer depth, colour and semantic id as images, and a page that
shows them needs a bitmap. A 64 × 64 frame drawn as SVG is four thousand
rectangles; drawn as PNG it is a few hundred bytes and the browser does the
work.

Only what a frame needs is implemented: 8-bit greyscale (depth) and 8-bit
colour (rgba), one filter, one deflate stream. `:zlib` and `:erlang.crc32` are
the standard library, so this is a file format rather than a dependency.

# `rows`

```elixir
@type rows() :: [[number()]]
```

# `greyscale`

```elixir
@spec greyscale(rows()) :: binary()
```

A greyscale PNG of `rows`, each a list of values from 0 (black) to 255.

Depth is drawn this way: one channel, because there is one number per pixel.

# `rgb`

```elixir
@spec rgb([[[number()]]]) :: binary()
```

A colour PNG of `rows`, each a list of `[r, g, b]` from 0 to 255.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
