Pngex.new

You're seeing just the function new, go back to Pngex module for more information.
Link to this function

new(opts \\ [])

Specs

new(keyword()) :: t() | {:error, keyword()}

Creates a new Pngex structure.

Options

  • :type - color type;
    • :gray - grayscale
    • :rgb - RGB (default)
    • :indexed - palette color
    • :gray_and_alpha - grayscale and alpha
    • :rgba - RGB and alpha
  • :depth - color depth; :depth2, :depth4, :depth8 (default) or :depth16
  • :width - image width; 32-bit integer (1..4,294,967,295)
  • :height - image height; 32-bit integer (1..4,294,967,295)
  • :palette - palette table; list of RGB color tuples

Examples

pngex =
  Pngex.new(
    type: :indexed,
    depth: :depth8,
    width: 640,
    height: 480,
    palette: [{0, 0, 0}, {255, 255, 255}]
  )