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

Copy Markdown View Source

Output format / encoder configuration. Lives on the pipeline rather than in the op list — there is exactly one per pipeline.

:type is the requested output format; :auto defers to content negotiation (Accept header) at encode time. The encoder may substitute a fallback format and add a header noting the substitution (currently only :avif -> :webp when libvips lacks AVIF support).

Summary

Types

chroma_subsampling()

@type chroma_subsampling() :: nil | :auto | :on | :off

compression()

@type compression() :: nil | :fast

metadata()

@type metadata() :: :copyright | :keep | :none

t()

@type t() :: %Image.Plug.Pipeline.Ops.Format{
  anim?: boolean(),
  chroma_subsampling: chroma_subsampling(),
  compression: compression(),
  dpr: pos_integer(),
  lossy: nil | boolean(),
  metadata: metadata(),
  progressive: nil | boolean(),
  quality: 1..100,
  scq_quality: nil | 1..100,
  type: type()
}

type()

@type type() ::
  :auto
  | :avif
  | :webp
  | :jpeg
  | :baseline_jpeg
  | :png
  | :gif
  | :tiff
  | :jp2
  | :pdf
  | :json