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

Convert the image to a different colorspace.

Wraps `Image.to_colorspace/2`. Covers two CDN-grammar features
with one IR primitive:

* **Monochrome** — `target: :bw` produces a true 1-channel
  grayscale image (smaller bytes than `Adjust{saturation: 0.0}`).
  Used by imgix's `monochrome=<hex>` (the hex tint is not yet
  honoured — v0.1 produces plain B&W).

* **Colorspace conversion** — any other target. Used by imgix's
  `cs=<space>` and Cloudinary's `cs_<space>`. Common values
  include `:srgb`, `:cmyk`, `:rgb`, `:lab`, `:hsv`. See
  `Image.Interpretation.known_interpretations/0` for the full
  list `Image.to_colorspace/2` accepts.

### Pipeline ordering

The `Image.Plug.Pipeline.Normaliser` slots `Colorspace` between
`Adjust` (which expects RGB) and `ReplaceColor` (whose colour
matching operates on the post-conversion bytes). When you don't
use `Adjust` or `ReplaceColor`, the relative order doesn't matter.

# `t`

```elixir
@type t() :: %Image.Plug.Pipeline.Ops.Colorspace{target: atom()}
```

---

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