Elxvips
Experimental Elixir bindings to libvips for image processing, since it's supposed to be faster than GraphicsMagick/ImageMagick. It is based on the existing Rust bindings to libVips. To make it work you will require libVips and the rust compiler. Please refer to Dockerfile for dependencies.
Documentation
Full documentation can be found at https://hexdocs.pm/elxvips.
Installation
Install build dependencies
MacOS
# install rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
brew install vips llvmUbuntu/Debian
# install rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install libvips-dev rustc clang
The package can be installed by adding elxvips to your list of dependencies in mix.exs:
def deps do
[
{:elxvips, "~> 0.1.1"}
]
endExample
import Elxvips
from_file( "image.png" )
|> resize( height: 100 )
|> jpg( strip: true )
|> to_file( "output.jpg" )
{ :ok, %ImageFile{} }