# `Storehouse.Image.ThumbHash`
[🔗](https://github.com/hattoriai/storehouse/blob/v0.2.0/lib/storehouse/image/thumb_hash.ex#L1)

[ThumbHash](https://evanw.github.io/thumbhash/): an image's placeholder
in about 25 bytes, its colours, its proportions and its transparency, for
a page to decode into a blur (`thumbhash` on npm, and ports in most
languages). The same bytes as its reference implementation, from the
image's pixels: `Storehouse.Analyzer.ThumbHash` gives them from a stored
file.

# `encode`

```elixir
@spec encode(pos_integer(), pos_integer(), binary()) :: binary()
```

The ThumbHash of an image of `width` × `height` pixels, at most 100 each,
given as RGBA, eight bits a band, row by row.

    iex> red = :binary.copy(<<255, 0, 0, 255>>, 4)
    iex> Storehouse.Image.ThumbHash.encode(2, 2, red) |> Base.encode64()
    "1fsrBwB4CIeIiIiHiIiICIiH6OAIDo4A"

---

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