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. Please refer to Dockerfile for dependencies.
Documentation
Full documentation can be found at https://hexdocs.pm/elxvips.
Example
import Elxvips
from_file( "image.png" )
|> resize( height: 100 )
|> jpg( strip: true )
|> to_file( "output.jpg" )
{ :ok, %ImageFile{} }Installation
The package can be installed by adding elxvips to your list of dependencies in mix.exs:
def deps do
[
{:elxvips, "~> 0.1.3"}
]
endPrecompiled NIFs
Since version 0.1.3 Elxvips comes with some precompiled nifs, and depends only on libvips.
Installing libvips
MacOS
brew install vips llvmUbuntu/Debian
apt install libvipsInstall build dependencies
In case you require to compile the nifs from source, you would need to install rust and pkg-config.
MacOS
# install rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shUbuntu/Debian
# install rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install rustc clang