imago v0.2.15 Imago View Source
Link to this section Summary
Functions
Applies a bayer filter to an image
Applies a floyd-steinberg filter to an image
Re-saves an image as a jpeg.
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
Saves a PGM image to the given path
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.
Applies a threshold filter to an image
Link to this section Functions
dither_bayer(path, threshold) View Source
Applies a bayer filter to an image
iex> Imago.test_image() |> Imago.dither_bayer(128) |> Imago.slice5
{:ok, {64, 64, [0, 0, 0, 0, 0, 0]}}
dither_floyd_steinberg(path, threshold) View Source
Applies a floyd-steinberg filter to an image
iex> Imago.test_image() |> Imago.dither_floyd_steinberg(128) |> Imago.slice5
{:ok, {64, 64, [255, 255, 255, 255, 255, 255]}}
flatten_as_jpg(path) View Source
Re-saves an image as a jpeg.
iex> Imago.test_image() |> Imago.flatten_as_jpg
{:ok, "/home/lucas/Bureau/DIVERS_EN_COURS/Imago/lib/../test_image.jpg.jpg"}
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.slicefp5
{: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.slicefp5
{: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, {64, 64, [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, {64, 64, [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, {64, 64, [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, {64, 64, [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, {64, 64, [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, {64, 64, [198, 198, 198, 255, 198, 198]}}
save_pgm(arg, path) View Source
Saves a PGM image to the given path
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.
slicefp5(arg) View Source
test_image() View Source
threshold(path, threshold) View Source
Applies a threshold filter to an image
iex> Imago.test_image() |> Imago.threshold(128) |> Imago.slice5
{:ok, {64, 64, [255, 255, 255, 255, 255, 255]}}