pixels v0.3.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 or JPEG image from raw binary input data.

Decode a PNG or JPEG 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(data)

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

Decode a PNG or JPEG image from raw binary input data.

Link to this function

read_file(filename)

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

Decode a PNG or JPEG image from a file.