Packages

A pluggable Plug-based image server. Maps URLs to a canonical image processing pipeline executed via the Image library, with named, stored variants. Ships a Cloudflare Images URL provider.

Current section

Files

Jump to
image_plug lib image plug pipeline ops opacity.ex
Raw

lib/image/plug/pipeline/ops/opacity.ex

defmodule Image.Plug.Pipeline.Ops.Opacity do
@moduledoc """
Mid-pipeline alpha multiplier. `:factor` is in `[0.0, 1.0]`;
`1.0` is a no-op (the normaliser drops the op), `0.0` produces
a fully transparent image. Maps to Cloudinary's `o_<n>`
(where `n / 100` is passed) and ImageKit's `e-opacity:<n>`.
"""
@type t :: %__MODULE__{factor: float()}
defstruct factor: 1.0
end