imgutils v0.1.0 ImgUtils View Source

Collection of image processing utilities.

Link to this section Summary

Link to this section Functions

Link to this function

resize(in_binary, in_width, in_height, num_channels, out_width, out_height) View Source
resize(
  in_content :: binary(),
  in_width :: pos_integer(),
  in_height :: pos_integer(),
  num_channels :: pos_integer(),
  out_width :: pos_integer(),
  out_height :: pos_integer()
) :: {:ok, binary()} | {:error, :resize}

Resize an image.

Examples

iex> image = <<255, 0, 0, 0, 255, 0, 0, 0, 255>> iex> width = 3; height = 1; channels = 3; out_width = 3; out_height = 5 iex> ImgUtils.resize(image, width, height, channels, out_width, out_height) {:ok, <<241, 14, 0, 14, 227, 14, 0, 14, 241, 241, 14, 0, 14, 227, 14, 0, 14, 241, 241, 14, 0, 14, 227, 14, 0, 14, 241, 241, 14, 0, 14, 227, 14, 0, 14, 241, 241, 14, 0, 14, 227, 14, 0, 14, 241>>}