Gm

Idiomatic GraphicsMagick wrapper for Elixir.

Prerequisites

Make sure you have GraphicsMagick installed on your system.

Installation

Add gm to your list of dependencies in mix.exs:

def deps do
  [{:gm, "~> 0.0.1"}]
end

and run mix deps.get.

Usage

Creating a thumbnail

Gm.open("large.jpg")
|> Gm.resize(100, 100)
|> Gm.write("thumbnail.jpg") # => :ok

Writing text over an image

Gm.open("image.jpg")
|> Gm.font("Fira-Sans.ttf")
|> Gm.point_size(24)
|> Gm.fill("red")
|> Gm.draw_text(400, 100, "This is a caption")
|> Gm.write("captioned.jpg") # => :ok

More examples coming soon.

License

MIT