# `Image.Plug.Pipeline.Ops.Trim`
[🔗](https://github.com/elixir-image/image_plug/blob/v0.1.0/lib/image/plug/pipeline/ops/trim.ex#L1)

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.

# `mode`

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

# `t`

```elixir
@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()
}
```

---

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