vtracer-bench: codec-free library, codecs behind a cli feature
Rust / test (push) Has been cancelled
Rust / wasm-safety (core) (push) Has been cancelled
Rust / Node package (push) Has been cancelled

- The library now speaks the image crate's buffer types only:
  fidelity(&RgbImage, &RgbImage, thresh) -> (FidelityReport, GrayImage).
  A tracer embedding the metric pulls no image codec at all.
- New `cli` feature (default on) brings png/jpeg/webp decoding and
  gates the vtracer-bench bin (required-features).
- dssim-core with default features off: drops the rayon thread pool.
- Scores are unchanged: the CLI prints the same value before and after.
This commit is contained in:
Chris Tsang
2026-09-06 18:49:34 +01:00
parent 74c29b1a8c
commit e9fece97b8
4 changed files with 40 additions and 84 deletions
+4 -13
View File
@@ -37,22 +37,13 @@ fn main() {
}
let orig = image::open(&args[1]).expect("open original").to_rgb8();
let (w, h) = (orig.width() as usize, orig.height() as usize);
let img = image::open(&args[2]).expect("open candidate").to_rgb8();
assert_eq!(
(img.width() as usize, img.height() as usize),
(w, h),
"candidate raster must match original dimensions"
);
let cand: Vec<u8> = img.into_raw();
let cand = image::open(&args[2]).expect("open candidate").to_rgb8();
assert_eq!(cand.dimensions(), orig.dimensions(), "candidate raster must match original dimensions");
let (r, mask) = fidelity(orig.as_raw(), &cand, w, h, thresh);
let (r, mask) = fidelity(&orig, &cand, thresh);
if let Some(out) = mask_out {
image::GrayImage::from_raw(w as u32, h as u32, mask)
.unwrap()
.save(&out)
.expect("save mask");
mask.save(&out).expect("save mask");
}
println!(