Image.Interpretation (image v0.59.0)

View Source

Defines the known color interpretations to which an image can be converted to and from.

Summary

Types

t()

Defines the known colorspace interpretations.

Functions

Returns the known colorspace interpretations

Normalizes and validates a color interpretation.

Types

t()

@type t() ::
  :hsv
  | :scrgb
  | :grey16
  | :rgb16
  | :fourier
  | :yxy
  | :labs
  | :lch
  | :cmc
  | :labq
  | :histogram
  | :multiband
  | :cmyk
  | :srgb
  | :lab
  | :xyz
  | :rgb
  | :bw
  | :matrix

Defines the known colorspace interpretations.

Functions

known_interpretations()

Returns the known colorspace interpretations

validate_interpretation(interpretation)

Normalizes and validates a color interpretation.

Arguments

Returns

  • {:error, normalized_interpretation} or

  • {:error, reason}

Examples

iex> Image.Interpretation.validate_interpretation(:bw)
{:ok, :VIPS_INTERPRETATION_B_W}

iex> Image.Interpretation.validate_interpretation(:VIPS_INTERPRETATION_sRGB)
{:ok, :VIPS_INTERPRETATION_sRGB}

iex> Image.Interpretation.validate_interpretation(:unknown)
{:error, "Unknown interpretation. Found :unknown"}