Optipng
This module is a simple wrapper of optipng command line application for optimising PNG images.
To use this module, make sure you have optipng executable in you $PATH.
Installation
add optipng to your list of dependencies in mix.exs:
def deps do
[
{:optipng, "~> 0.1.0"}
]
endUsage
optimise/1
file_path = "my-pretty-image.png"
file_path
|> File.read!
|> Optipng.optimise
#=> {:ok, optimised_content}optimise/2
file_path = "my-pretty-image.png"
file_path
|> File.read!
|> Optipng.optimise(self())
# continue doing anything you want
receive do
{:ok, optimised_content} ->
# deal with it
end