PNG image library for Gleam
Go to file
LilyRose2798 de1268d035 Fix readme code 2024-06-04 18:55:24 +10:00
.github/workflows Initial commit 2024-06-04 18:44:05 +10:00
src Add CompressionLevel re-export 2024-06-04 18:48:35 +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 Fix readme code 2024-06-04 18:55:24 +10:00
gleam.toml Bump version 2024-06-04 18:49:06 +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>>,
  ]
  |> pngleam.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