PNG image library for Gleam
Go to file
LilyRose2798 6ac7f0e800 Initial commit 2024-06-04 18:44:05 +10:00
.github/workflows Initial commit 2024-06-04 18:44:05 +10:00
src Initial commit 2024-06-04 18:44:05 +10:00
test Initial commit 2024-06-04 18:44:05 +10:00
.gitignore Initial commit 2024-06-04 18:44:05 +10:00
README.md Initial commit 2024-06-04 18:44:05 +10:00
gleam.toml Initial commit 2024-06-04 18:44:05 +10:00
manifest.toml Initial commit 2024-06-04 18:44:05 +10:00

README.md

pngleam

Package Version Hex Docs

gleam add pngleam
import pngleam

pub fn main() {
  [
    <<0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF>>,
    <<0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF>>,
    <<0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x80>>,
  ]
  |> gleam_png.from_packed(
    width: 3,
    height: 3,
    color_info: pngleam.rgb_8bit,
    compression_level: pngleam.default_compression,
  )
  |> simplifile.write_bits("img.png", _)
}

Further documentation can be found at https://hexdocs.pm/pngleam.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell