# `FrenchCurve.Backend.Iterm2`
[🔗](https://github.com/jaman/french_curve/blob/v0.1.4/lib/french_curve/backend/iterm2.ex#L1)

Renders a raster with iTerm2's inline-image protocol, as a base64 PNG in an OSC 1337
sequence.

True RGBA, so transparency is kept. The protocol has no stored images: every draw sends
the whole picture, which is why `FrenchCurve.Sprite.upload/3` does nothing here.

    IO.write(FrenchCurve.Backend.Iterm2.render(raster, fit: {20, 10}))

# `render`

```elixir
@spec render(
  FrenchCurve.Raster.t(),
  keyword()
) :: binary()
```

Returns the escape sequence that draws `raster` at the cursor.

The raster is encoded as a PNG by `FrenchCurve.Png.encode/3` and base64-wrapped.

## Options

  * `:fit` — `{cols, rows}`, the cell box to scale the image into. Sizing is in cells
    natively, so no cell-pixel size is needed. Aspect ratio is not preserved: the image
    is stretched to fill the box. Omitted by default, which leaves iTerm2 to size the
    image from its pixel dimensions.

---

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