imago v0.1.0 Imago View Source
Link to this section Summary
Functions
Alias for get_fingerprint_4x4
Returns an image's fingerprint, sampled on a 4x4 luminance grid
Returns an image's fingerprint, sampled on a 8x8 luminance grid.
Returns the average luminance of an image, sampled on a 4x4 grid, as an int. See get_fingerprint_4x4 for details
Alias of read_pixels_rgba
Gets a list of alpha values
Gets a list of blue values
Gets a list of green values
Gets a list of red values
Gets a list of rgb values
Gets a list of rgba values
Since we use a 8x8 image, doctests would be polluted with lists of 4 * 64 integers. This ensures validity and conciseness. The real methods do return a list of integers.
Link to this section Functions
get_fingerprint(path) View Source
Alias for get_fingerprint_4x4
get_fingerprint_4x4(path) View Source
Returns an image's fingerprint, sampled on a 4x4 luminance grid
iex> Imago.test_image() |> Imago.get_fingerprint_4x4 |> Imago.slice5
{:ok, [207, 223, 174, 208, 225, 170]}
get_fingerprint_8x8(path) View Source
Returns an image's fingerprint, sampled on a 8x8 luminance grid.
iex> Imago.test_image() |> Imago.get_fingerprint_8x8 |> Imago.slice5
{:ok, [198, 222, 222, 227, 209, 161]}
luminance(path) View Source
Returns the average luminance of an image, sampled on a 4x4 grid, as an int. See get_fingerprint_4x4 for details
iex> Imago.test_image() |> Imago.luminance
{:ok, 192}
read_pixels(path) View Source
Alias of read_pixels_rgba
read_pixels_alpha(path) View Source
Gets a list of alpha values
iex> Imago.test_image() |> Imago.read_pixels_alpha |> Imago.slice5
{:ok, [255, 255, 255, 255, 255, 255]}
read_pixels_blue(path) View Source
Gets a list of blue values
iex> Imago.test_image() |> Imago.read_pixels_blue |> Imago.slice5
{:ok, [198, 198, 198, 198, 198, 198]}
read_pixels_green(path) View Source
Gets a list of green values
iex> Imago.test_image() |> Imago.read_pixels_green |> Imago.slice5
{:ok, [198, 198, 198, 198, 198, 198]}
read_pixels_red(path) View Source
Gets a list of red values
iex> Imago.test_image() |> Imago.read_pixels_red |> Imago.slice5
{:ok, [198, 198, 198, 198, 198, 198]}
read_pixels_rgb(path) View Source
Gets a list of rgb values
iex> Imago.test_image() |> Imago.read_pixels_rgb |> Imago.slice5
{:ok, [198, 198, 198, 198, 198, 198]}
read_pixels_rgba(path) View Source
Gets a list of rgba values
iex> Imago.test_image() |> Imago.read_pixels_rgba |> Imago.slice5
{:ok, [198, 198, 198, 255, 198, 198]}
slice5(arg) View Source
Since we use a 8x8 image, doctests would be polluted with lists of 4 * 64 integers. This ensures validity and conciseness. The real methods do return a list of integers.