-
Notifications
You must be signed in to change notification settings - Fork 20
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
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use clap::{arg, value_parser, Command}; | ||
use indoc::indoc; | ||
|
||
pub fn avif() -> Command { | ||
Command::new("avif") | ||
.about("Encode images into AVIF format") | ||
.args([ | ||
arg!(-q --quality <NUM> "Quality which the image will be encoded with") | ||
.value_parser(value_parser!(u8).range(1..=100)) | ||
.default_value("50"), | ||
arg!(--alpha_quality <NUM> "Separate alpha quality which the image will be encoded with") | ||
.value_parser(value_parser!(u8).range(1..=100)), | ||
arg!(--speed <NUM> "Compression speed (effort)") | ||
.long_help(indoc! {"Compression speed (effort) | ||
1 = very very slow, but max compression | ||
10 = quick, but larger file sizes and lower quality."}) | ||
.value_parser(value_parser!(u8).range(1..=10)) | ||
.default_value("6"), | ||
arg!(--colorspace <COLOR> "Set color space of AVIF being written") | ||
.value_parser(["ycbcr", "rgb"]) | ||
.default_value("ycbcr"), | ||
arg!(--alpha_mode <MODE> "Configure handling of color channels in transparent images") | ||
.value_parser(["UnassociatedDirty", "UnassociatedClean", "Premultiplied"]) | ||
.default_value("UnassociatedClean") | ||
]) | ||
} |
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