# `Image.Options.Mapim`
[🔗](https://github.com/elixir-image/image/blob/v0.73.0/lib/image/options/mapim.ex#L1)

Options shared by transformations implemented with `Vix.Vips.Operation.mapim/3`.

# `background_option`

```elixir
@type background_option() :: {:background, Image.BackgroundColor.spec() | nil}
```

A background fill option for a mapim-based transformation.

# `background_options`

```elixir
@type background_options() :: [interpolate_option() | background_option()]
```

Interpolation and background options for transformations that expose canvas.

# `extend_mode`

```elixir
@type extend_mode() :: :background | :copy
```

How the interpolator synthesizes the one-pixel fringe just beyond
the content edge when resampling boundary pixels.

* `:background` (the default) blends the fringe toward the
  `:background` color. This is correct whenever the transform
  exposes canvas.
* `:copy` clamps to the nearest content pixel. Use it when the
  content fills the whole canvas, where the default would leave a
  faint border along the outermost row and column.

# `extend_option`

```elixir
@type extend_option() :: {:extend_mode, extend_mode()}
```

An interpolation-boundary option for a mapim-based transformation.

# `interpolate`

```elixir
@type interpolate() :: :nearest | :bilinear | :bicubic | :lbb | :nohalo | :vsqbs
```

The interpolators that may be selected with the `:interpolate`
option (descriptions from `vips -l interpolate`):

* `:nearest` - nearest-neighbour interpolation
* `:bilinear` - bilinear interpolation
* `:bicubic` - bicubic interpolation (Catmull-Rom)
* `:lbb` - reduced halo bicubic
* `:nohalo` - edge sharpening resampler with halo reduction
* `:vsqbs` - B-Splines with antialiasing smoothing

`:bilinear` is the default except for `Image.distort/4`, which
retains its existing `:bicubic` default.

# `interpolate_option`

```elixir
@type interpolate_option() :: {:interpolate, interpolate()}
```

An interpolation option for a mapim-based transformation.

# `interpolate_options`

```elixir
@type interpolate_options() :: [interpolate_option()]
```

Interpolation options for transformations with fixed boundary handling.

# `t`

```elixir
@type t() :: [interpolate_option() | background_option() | extend_option()]
```

Interpolation, background and boundary options for a mapim-based transformation.

# `validate_options`

```elixir
@spec validate_options(Vix.Vips.Image.t(), Keyword.t(), [option_name()]) ::
  {:ok, Keyword.t()} | {:error, Image.error()}
```

Validates the allowed options for a mapim-based transformation.

All mapim options are allowed by default.

---

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