Image.Options.Mapim (image v0.73.0)

Copy Markdown View Source

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

Summary

Types

A background fill option for a mapim-based transformation.

Interpolation and background options for transformations that expose canvas.

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

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

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

An interpolation option for a mapim-based transformation.

Interpolation options for transformations with fixed boundary handling.

t()

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

Types

background_option()

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

A background fill option for a mapim-based transformation.

background_options()

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

Interpolation and background options for transformations that expose canvas.

extend_mode()

@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()

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

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

interpolate()

@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()

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

An interpolation option for a mapim-based transformation.

interpolate_options()

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

Interpolation options for transformations with fixed boundary handling.

t()

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

Functions

validate_options(image, options, allowed_options \\ [:interpolate, :background, :extend_mode])

@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.