https://github.com/dpostolachi/elxvips
Image processing in Elixir with NIF Bindings to libvips through rustler
https://github.com/dpostolachi/elxvips
elixir image-processing libvips
Last synced: 6 months ago
JSON representation
Image processing in Elixir with NIF Bindings to libvips through rustler
- Host: GitHub
- URL: https://github.com/dpostolachi/elxvips
- Owner: dpostolachi
- Created: 2020-07-14T13:10:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-23T14:43:00.000Z (10 months ago)
- Last Synced: 2025-07-09T14:01:02.593Z (7 months ago)
- Topics: elixir, image-processing, libvips
- Language: Rust
- Homepage:
- Size: 13 MB
- Stars: 14
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elxvips
[](https://travis-ci.org/dpostolachi/elxvips)
Experimental Elixir bindings to libvips for image processing, since it's supposed to be [faster](https://github.com/libvips/libvips/wiki/Speed-and-memory-use) than GraphicsMagick/ImageMagick. It is based on the existing Rust [bindings](https://github.com/augustocdias/libvips-rust-bindings) to libVips. To make it work you will require libVips. Please refer to [Dockerfile](https://github.com/dpostolachi/elxvips/blob/master/Dockerfile) for dependencies.
## Documentation
Full documentation can be found at [https://hexdocs.pm/elxvips](https://hexdocs.pm/elxvips/Elxvips.html).
## Example
```elixir
import Elxvips
from_file( "image.png" )
|> resize( height: 100 )
|> jpg( strip: true )
|> to_file( "output.jpg" )
{ :ok, %ImageFile{} }
```
## Installation
The [package](https://hex.pm/packages/elxvips) can be installed by adding `elxvips` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:elxvips, "~> 0.1.7"}
]
end
```
## Precompiled NIFs
Since version `0.1.3` Elxvips comes with some precompiled nifs, and depends only on libvips.
### Installing libvips
#### MacOS
```bash
brew install vips llvm
```
#### Ubuntu/Debian
```bash
apt install libvips
```
### Install build dependencies
In case you require to compile the nifs from source, you would need to install rust and pkg-config.
#### MacOS
```bash
# install rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
#### Ubuntu/Debian
```bash
# install rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install rustc clang
```