#lua #image #lua-bindings #api-bindings

mlua-image

Lua bindings and embedding of the Rust based 'image' imaging library

4 releases

0.1.3 Mar 2, 2024
0.1.2 Feb 3, 2024
0.1.1 Jan 13, 2024
0.1.0 Jan 7, 2024

#344 in Images

Download history 37/week @ 2024-01-08 79/week @ 2024-01-15 63/week @ 2024-01-29 2/week @ 2024-02-05 51/week @ 2024-02-12 17/week @ 2024-02-19 137/week @ 2024-02-26 29/week @ 2024-03-04 87/week @ 2024-03-11 57/week @ 2024-03-18 21/week @ 2024-03-25 62/week @ 2024-04-01

229 downloads per month
Used in mlua-tract

MIT license

285KB
1K SLoC

mlua-image

Lua bindings for the image imaging library.

License Arch Lua

Installing

Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].

$ cargo add mlua-image --features luajit

Using

use mlua::Lua;
use mlua_image;

let lua = Lua::new();
mlua_image::preload(&lua)?;
let script = r#"
    local image = require('image')
    local img = image.open('testdata/fractal.png')
    img:save_with_format('fractal.gif', 'gif')
    return img:height(), img:width()
"#;
let (height, width): (u32, u32) = lua.load(script).eval()?; // returns: (800, 800)

Testing

$ make check

Dependencies

~16MB
~109K SLoC