# `Drafter.Widget.Digits.Image`
[🔗](https://github.com/jaman/drafter/blob/main/lib/drafter/widget/digits/image.ex#L1)

Draws `Drafter.Widget.Digits` text as a transmitted terminal image.

On a terminal supporting the kitty, iTerm2, or sixel protocol, the glyph
bitmaps are scaled into a raster and sent as a picture, so strokes land on
pixel rather than cell boundaries.

Every function returns `nil` when no protocol is available, and the widget
renders cells instead.

# `picture`

```elixir
@spec picture(String.t(), {pos_integer(), pos_integer()}, tuple(), atom() | nil) ::
  Drafter.Render.Picture.t() | nil
```

Renders text as a `Drafter.Render.Picture` filling a cell box at the widget's top
left.

Returns `nil` when the text is empty, the box has no area, or the terminal cannot
display an image.

# `protocol`

```elixir
@spec protocol(atom() | nil) :: atom() | nil
```

The pixel protocol in use, or `nil` when the terminal has none.

# `raster`

```elixir
@spec raster([String.t()], {pos_integer(), pos_integer()}, tuple()) ::
  FrenchCurve.Raster.t()
```

Rasterises text at the largest whole scale that fits a cell box.

Scale is never below one; a box too small for native size is handled by the
encoder's `fit`, which scales the finished picture down.

---

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