PNG generation support for Vivid.
Find a file
2019-03-04 15:10:38 +13:00
config Initial commit. 2017-01-12 08:40:31 +13:00
lib Update Elixir version and deps. 2018-09-04 02:52:12 +00:00
test Initial commit. 2017-01-12 08:40:31 +13:00
.formatter.exs Update Elixir version and deps. 2018-09-04 02:52:12 +00:00
.gitignore Initial commit. 2017-01-12 08:40:31 +13:00
.gitlab-ci.yml Add formatting check. 2018-09-04 15:05:12 +12:00
example.png Update typespecs and docs. 2017-01-12 08:55:58 +13:00
LICENSE Update MIT license file 2019-03-04 15:10:38 +13:00
mix.exs Update Elixir version and deps. 2018-09-04 02:52:12 +00:00
mix.lock Update Elixir version and deps. 2018-09-04 02:52:12 +00:00
README.md Add example image to readme. 2017-01-12 08:58:06 +13:00

Vivid.PNG

Vivid.PNG adds PNG generating support to Vivid, a 2D rendering library implemented 100% in Elixir with no dependencies.

Installation

Available in Hex, the package can be installed by adding vivid_png to your list of dependencies in mix.exs:

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

License

Source code is licensed under the terms of the MIT license, the text of which is included in the LICENSE file in this distribution.

Documentation

Documentations can be found at https://hexdocs.pm/vivid_png.

Status

use Vivid
alias Vivid.PNG

frame  = Frame.init(300,200)
text   = Font.line("seems to work")
         |> Transform.fill(frame)
         |> Transform.center(frame)
         |> Transform.apply
circle = Circle.init(Point.init(100, 100), 50)
box    = Box.init(Point.init(250,150), Point.init(275, 175))

frame
|> Frame.push(text,   RGBA.black)
|> Frame.push(circle, RGBA.init(1,0,0,0.5))
|> Frame.push(box,    RGBA.init(0,0,1, 0.75))
|> PNG.to_png("example.png")

example.png