Imageflow_ex - FFI bindings to a blazing fast Rust-based processing tool, along with a proper Elixir-style API

I just released the first working version of imageflow_ex, a package that provides bindings and a custom API to imageflow, which is a Rust-based image processing tool

Imageflow itself has incredible benchmarks when comparing to vips & imagemagick

I also took some time to implement a proper Elixir-style API, that makes image processing look very similar to Elixir Streams. One example:

alias Imageflow.Graph

Graph.new()
|> Graph.decode_file(@input_path)
|> Graph.branch(fn graph ->
  # 2160px wide image for retina displays graph
  |> Graph.constrain(2160, nil)
  |> Graph.encode_to_file("desktop@2x.png")
end)
|> Graph.branch(fn graph ->   # 1080px wide image for desktop
  graph
  |> Graph.constrain(1080, nil)
  |> Graph.encode_to_file("desktop.png")
end)
|> Graph.branch(fn graph ->   # 600px wide image for mobile
  graph
  |> Graph.constrain(600, nil)
  |> Graph.encode_to_file("mobile.png")
end)
|> Graph.run()
9 Likes