PNG image library for Gleam
Go to file
LilyRose2798 bdfffee3d7 Add initial functional (but slow) png parsing 2024-06-10 00:12:28 +10:00
.github/workflows Initial commit 2024-06-04 18:44:05 +10:00
src Add initial functional (but slow) png parsing 2024-06-10 00:12:28 +10:00
test Initial commit 2024-06-04 18:44:05 +10:00
.gitignore Add initial functional (but slow) png parsing 2024-06-10 00:12:28 +10:00
README.md Fix readme code 2024-06-04 18:55:24 +10:00
gleam.toml Add initial functional (but slow) png parsing 2024-06-10 00:12:28 +10:00
manifest.toml Add initial functional (but slow) png parsing 2024-06-10 00:12:28 +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