pixels v0.1.0 Pixels View Source

Elixir module to decode pixel data from image files.

Currently only PNG files are supported.

Link to this section Summary

Types

t()

The main struct for the image data.

Functions

Decode a PNG image from raw binary input data

Decode a PNG image from a file

Link to this section Types

Link to this type

t()

View Source
t() :: %Pixels{data: binary(), height: integer(), width: integer()}

The main struct for the image data.

Contains fields width, height, and data; data is a binary which contains the decoded RGBA data for the image.

Link to this section Functions

Link to this function

read(buffer)

View Source
read(data :: binary()) :: {:ok, Pixels.t()} | {:error, :invalid_data}

Decode a PNG image from raw binary input data

Link to this function

read_file(filename)

View Source
read_file(filename :: String.t()) ::
  {:ok, Pixels.t()} | {:error, :not_found} | {:error, :invalid_data}

Decode a PNG image from a file