diff options
Diffstat (limited to 'squash/src')
-rw-r--r-- | squash/src/cli.rs | 6 | ||||
-rw-r--r-- | squash/src/main.rs | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/squash/src/cli.rs b/squash/src/cli.rs index d47d26b..96a0798 100644 --- a/squash/src/cli.rs +++ b/squash/src/cli.rs @@ -107,6 +107,7 @@ pub enum Selector { #[default] SortSelect, Kmeans, + HighestBits, } pub fn build() -> Cli { @@ -180,6 +181,7 @@ pub fn build() -> Cli { Some(("selector", sel)) | Some(("sel", sel)) => match sel { "sort/select" | "sorsel" => building.selector = Selector::SortSelect, "kmeans" => building.selector = Selector::Kmeans, + "highest-bits" => building.selector = Selector::HighestBits, _ => { eprintln!("'{sel}' is not recognized as a selector. See help=selectors"); std::process::exit(1); @@ -264,6 +266,10 @@ fn print_help_selectors() -> ! { println!("kmeans:"); println!(" uses the kmeans clustering algorithm to select colours."); println!(" Ignores tolerance="); + println!("highest-bits:"); + println!(" quantizes the colours by shifting the bits of their components until"); + println!(" they all fit in the palette."); + println!(" Ignores tolerance="); std::process::exit(0) } diff --git a/squash/src/main.rs b/squash/src/main.rs index c0cea51..878ae37 100644 --- a/squash/src/main.rs +++ b/squash/src/main.rs @@ -1,7 +1,7 @@ use std::time::Duration; use colorsquash::{ - selection::{Kmeans, SortSelect}, + selection::{HighestBits, Kmeans, SortSelect}, SquasherBuilder, }; @@ -34,6 +34,7 @@ fn main() -> Result<(), anyhow::Error> { builder = builder.selector(sorsel); } cli::Selector::Kmeans => builder = builder.selector(Kmeans { max_iter: 10 }), + cli::Selector::HighestBits => builder = builder.selector(HighestBits {}), }; let mut start = std::time::Instant::now(); |