summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs
index 8555232..ac28eb7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,16 +2,14 @@
use image::{ImageReader, Rgb};
use std::path::Path;
-const LIST_OF_SAMPLES: [&str; 2] = [
+const LIST_OF_SAMPLES: [&str; 6] = [
"samples/david.png",
"samples/david2.jpg",
- /*
- "samples/us.png",
- "samples/jane.jpg",
- "samples/jane2.webp",
- "samples/karel_käos.jpg",
- "samples/diderot_111.png",
- */
+ "samples/us.png",
+ "samples/jane.jpg",
+ "samples/jane2.webp",
+ "samples/karel_käos.jpg",
+ // "samples/diderot_111.png",
];
#[allow(dead_code)]
const PALETTE_3B: [Rgb<u8>; 8] = [
@@ -47,16 +45,17 @@ fn main() -> Result<(), image::ImageError> {
("kernel_ostromoukhov_1b", |img| {
dither::dither_ostromoukhov_1b(img)
}),
+ */
("kernel_ostromoukhov_3b", |img| {
dither::dither_ostromoukhov_3b(img)
}),
+ /*
("kernel_ostromoukhov_1b_alt", |img| {
dither::dither_ostromoukhov_1b_alt2(img)
}),
("bayer_3b", |img| dither::dither_bayer(256, img)),
*/
("scolorq", |_img| dither::dither_scolorq(_img, 16)),
- /*
("kernel_jarvis_judice_ninke_linear_3b", |img| {
dither::dither_palette_linear(
img,
@@ -73,10 +72,12 @@ fn main() -> Result<(), image::ImageError> {
},
)
}),
+ /*
("random_1b", dither::dither_random),
("random_3b", dither::dither_random_color),
("threshold_1b", dither::dither_threshold_1b),
("threshold_3b", dither::dither_threshold_3b),
+ */
("burkes_3b", |img| {
dither::dither_shift_8colors(
img,
@@ -85,10 +86,10 @@ fn main() -> Result<(), image::ImageError> {
bit_shift: dither::kernel::BURKES_KERNEL_BIT_SHIFT,
},
)
- }),*/
+ }),
];
- for sample in ["samples/us.png"] {
+ for sample in LIST_OF_SAMPLES {
for (suffix, algo) in &algos {
println!("{} on {}", suffix, sample);
let path = Path::new(sample);