From 14548ad9946d60a0d28f3ac604b217a467c0be05 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sat, 8 Jul 2023 17:18:57 -0400 Subject: convert dashboard to grayscale --- flake.nix | 1 + src/main.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/flake.nix b/flake.nix index c29f113..4e5d1b6 100644 --- a/flake.nix +++ b/flake.nix @@ -145,6 +145,7 @@ geckodriver pkg-config openssl + imagemagick ]; }; }); diff --git a/src/main.rs b/src/main.rs index 230da83..b3635ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,6 +43,12 @@ async fn main() -> Result<(), Box> { let output_path = Path::new(&args.path); let tmp_path = output_path.with_extension("png.tmp"); fs::write(&tmp_path, img)?; + + Command::new("mogrify") + .arg("-colorspace") + .arg("gray") + .arg(tmp_path.as_os_str()) + .spawn()?.wait()?; fs::rename(&tmp_path, output_path)?; time::sleep(Duration::from_secs(15)).await; info!("Wrote {}", output_path.display()); -- cgit v1.2.3