png2aa 0.1.1

Convert PNG image to ASCII Art.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate ndarray;
use ndarray::*;

pub fn default() -> BinaryFilter {
    BinaryFilter{
        thresh: 200
    }
}

pub struct BinaryFilter {
    pub thresh: u32
}

impl BinaryFilter {
    pub fn run (&self, img: Array2<f32>) -> Array2<i8> {
        img.mapv(|e| if e > self.thresh as f32 { 1 } else { 0 } )
    }
}