-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
131 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use clap::{arg, value_parser, Command}; | ||
|
||
pub fn mozjpeg() -> Command { | ||
Command::new("mozjpeg") | ||
.alias("moz") | ||
.about("Encode images into JPEG format using MozJpeg codec") | ||
.args([ | ||
arg!(-q --quality <NUM> "Quality, values 60-80 are recommended") | ||
.value_parser(value_parser!(u8).range(1..=100)) | ||
.default_value("75"), | ||
arg!(--chroma_quality <NUM> "Separate chrome quality") | ||
.value_parser(value_parser!(u8).range(1..=100)), | ||
arg!(--baseline "Set to use baseline encoding (by default is progressive)"), | ||
arg!(--no_optimize_coding "Set to make files larger for no reason"), | ||
arg!(--smoothing <NUM> "Use MozJPEG's smoothing") | ||
.value_parser(value_parser!(u8).range(1..=100)), | ||
arg!(--colorspace <COLOR> "Set color space of JPEG being written") | ||
.value_parser(["ycbcr", "grayscale", "rgb"]) | ||
.default_value("ycbcr"), | ||
arg!(--multipass "Specifies whether multiple scans should be considered during trellis quantization"), | ||
arg!(--subsample <PIX> "Sets chroma subsampling") | ||
.value_parser(value_parser!(u8).range(1..=4)), | ||
arg!(--qtable <TABLE> "Use a specific quantization table") | ||
.value_parser([ | ||
"AhumadaWatsonPeterson", | ||
"AnnexK", | ||
"Flat", | ||
"KleinSilversteinCarney", | ||
"MSSSIM", | ||
"NRobidoux", | ||
"PSNRHVS", | ||
"PetersonAhumadaWatson", | ||
"WatsonTaylorBorthwick" | ||
]) | ||
.default_value("NRobidoux") | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters