Skip to content
/ mirage Public
forked from scrogson/mirage

Image manipulation package for Elixir

License

Notifications You must be signed in to change notification settings

s0kil/mirage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Mirage

Image manipulation for Elixir.

This library provides a Rust implemented NIF which currently supports resizing images.

Installation

Because this library is partially implemented in Rust, you will need to have the Rust toolchain installed on your system.

Install Rust

curl https://sh.rustup.rs -sSf | sh

Add package to your mix.exs

If available in Hex, the package can be installed by adding mirage to your list of dependencies in mix.exs:

def deps do
  [
    {:mirage, "~> 0.1.0"}
  ]
end

Basic usage

{:ok, bytes} = File.read("/path/to/image.png")
{:ok, mirage} = Mirage.from_bytes(bytes)
{:ok, bytes, mirage} = Mirage.resize(mirage.resource, 400, 300)

mirage.width #=> 400
mirage.height #=> 300

File.write!("/path/to/resized-400x300.png", mirage.bytes)

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/mirage.

About

Image manipulation package for Elixir

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 50.4%
  • Elixir 47.5%
  • RenderScript 2.1%