Image.Plug.Pipeline.Ops.Trim (image_plug v0.1.0)

Copy Markdown View Source

Trim operation. Removes border pixels from the working image.

Two modes:

  • :border — auto-detect a uniform border colour and trim it. The optional :color field overrides the detected colour; :threshold controls similarity sensitivity (0..255).

  • :explicit — trim a fixed number of pixels from each edge given by the :top, :right, :bottom, :left fields.

Summary

Types

mode()

@type mode() :: :border | :explicit

t()

@type t() :: %Image.Plug.Pipeline.Ops.Trim{
  bottom: non_neg_integer(),
  color: nil | String.t(),
  left: non_neg_integer(),
  mode: mode(),
  right: non_neg_integer(),
  threshold: non_neg_integer(),
  top: non_neg_integer()
}