Linocut.Preview (Linocut v0.1.3)

Copy Markdown View Source

Looking at rasters: on a sheet, in a terminal, or as a PNG.

Linocut.Preview.sheet(headings, columns: 8, gap: 1)
|> Linocut.Preview.to_terminal()
|> IO.write()

to_terminal/2 picks the terminal's graphics protocol, or braille where it has none; protocol: forces one.

Summary

Functions

A raster with a one-pixel frame drawn around it, to see its edges.

The raster as PNG bytes.

One raster with rasters laid out in rows of columns.

The bytes that show raster in a terminal.

Functions

framed(raster, colour \\ :gray)

A raster with a one-pixel frame drawn around it, to see its edges.

png(raster)

@spec png(FrenchCurve.Raster.t()) :: binary()

The raster as PNG bytes.

sheet(rasters, opts \\ [])

One raster with rasters laid out in rows of columns.

Options

  • :columns — rasters per row. Default 8
  • :gap — pixels between rasters. Default 1
  • :background — the sheet's colour. Default transparent

to_terminal(raster, opts \\ [])

@spec to_terminal(FrenchCurve.Raster.t(), keyword()) :: iodata()

The bytes that show raster in a terminal.

Options

  • :protocol:kitty, :iterm2, :sixel or :braille. Default: detected
  • :fit{columns, rows} for pixel protocols