Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-05T22:21:36.000Z (10 months ago)
- Last Synced: 2024-10-16T09:35:57.374Z (4 months ago)
- Topics: elixir, image-processing, libvips
- Language: Rust
- Homepage:
- Size: 12.5 MB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elxvips
[![Build Status](https://travis-ci.org/dpostolachi/elxvips.png?branch=master)](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 Elxvipsfrom_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.3"}
]
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 | shapt install rustc clang
```