Linocut.Resample (Linocut v0.2.2)

Copy Markdown View Source

A picture redrawn at another size.

Linocut.Resample.to(raster, {320, 180})
Linocut.Resample.to(raster, {320, 180}, mode: :nearest)

:area averages the source pixels each target pixel covers, weighted by their alpha, so a shrunk picture keeps its edges where they were. :nearest takes the one source pixel at the middle of that area, which keeps hard pixel art hard.

Summary

Functions

raster at {width, height}.

Types

mode()

@type mode() :: :area | :nearest

Functions

to(raster, size, opts \\ [])

raster at {width, height}.

Options

  • :mode — :area or :nearest. Default :area