PNG generation support for Vivid.
Find a file
James Harton 1718cee34a
All checks were successful
continuous-integration/drone/push Build is passing
chore: Update package and readme links.
2024-03-06 20:02:54 +13:00
config chore: Update forgejo hostname. 2024-02-05 15:16:32 +13:00
lib chore: Modernise CI/CD and migrate. (#13) 2023-07-27 20:08:44 +12:00
test Initial commit. 2017-01-12 08:40:31 +13:00
.check.exs chore: Modernise CI/CD and migrate. (#13) 2023-07-27 20:08:44 +12:00
.drone.yml chore: Update forgejo hostname. 2024-02-05 15:16:32 +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
.tool-versions chore(deps): update dependency erlang to v26.2.2 2024-02-09 10:48:01 +13:00
CHANGELOG.md chore: set up git_ops and auto-releasing 2020-12-28 20:24:01 +13: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 chore: Update package and readme links. 2024-03-06 20:02:54 +13:00
mix.lock chore(deps): update dependency ex_check to ~> 0.16.0 2024-03-01 23:28:42 +13:00
README.md chore: Update package and readme links. 2024-03-06 20:02:54 +13:00
renovate.json chore: update renovate configuration. 2023-08-17 15:53:46 +12:00

Vivid.PNG

Build Status Hex.pm

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

Accessing on GitHub

This repository is mirrored to GitHub from it's home on harton.dev. Feel free to raise issues, etc, on GitHub.

Installation

Vivid.PNG is 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.2.0"}
  ]
end

Documentation for the latest release can be found on HexDocs and for the main branch on docs.harton.nz.

Github Mirror

This repository is mirrored on Github from it's primary location on my Forejo instance. Feel free to raise issues and open PRs on Github.

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.

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