blimp
Render BMP images in Gleam
gleam add blimp@1
import blimp
import simplifile
pub fn main() {
let width = 400
let height = 300
let bmp =
blimp.simple_render(width: width, height:, pixel: fn(x, y) {
let red = 255
let green = x * 255 / width
let blue = y * 255 / height
blimp.rgb(red:, green:, blue:)
})
let assert Ok(_) = simplifile.write_bits("out.bmp", bmp)
}
Further documentation can be found at https://hexdocs.pm/blimp.