#png #encoder #streaming

repng

The PNG encoder that no one asked for

4 releases

Uses old Rust 2015

0.2.2 Apr 5, 2018
0.2.1 Apr 5, 2018
0.2.0 Apr 5, 2018
0.1.0 Apr 5, 2018

#21 in #png

Download history 22/week @ 2020-12-31 39/week @ 2021-01-07 48/week @ 2021-01-14 36/week @ 2021-01-21 41/week @ 2021-01-28 27/week @ 2021-02-04 40/week @ 2021-02-11 44/week @ 2021-02-18 33/week @ 2021-02-25 26/week @ 2021-03-04 31/week @ 2021-03-11 16/week @ 2021-03-18 54/week @ 2021-03-25 83/week @ 2021-04-01 56/week @ 2021-04-08 50/week @ 2021-04-15

140 downloads per month
Used in scrap

MIT license

20KB
456 lines

repng

It encodes PNGs.

Usage

  1. Add repng = "0.2" to your Cargo.toml in the dependencies section.
  2. Check out an example.
  3. Read the documentation.

lib.rs:

The PNG encoder that no one asked for.

The abstraction is pretty leaky, but it's simple enough that you can make cool things without much effort, such as this program, which creates a very blank image.

use repng::Options;

let mut png = Vec::new();

{
    let mut encoder = Options::smallest(480, 360)
        .build(&mut png)
        .unwrap();

    let row = [255; 480 * 4];

    for y in 0..360 {
        encoder.write(&row).unwrap();
    }

    encoder.finish().unwrap();
}

println!("{:?}", png);

Dependencies

~330–440KB