add -near_lossless [0..100] experimental option

This compresses the uimage using lossless compression and controlable
decimating pre-process.
Code is under WEBP_EXPERIMENTAL_FEATURE while it's being experimented with.

Change-Id: I8b7f4cfcc3c6afc52a556102842bdbb045ed5ee8
This commit is contained in:
skal
2014-08-05 19:14:57 +02:00
parent 0524d9e5e8
commit b5a36cc9ad
11 changed files with 171 additions and 1 deletions

View File

@ -612,6 +612,10 @@ static void HelpLong(void) {
" green=0xe0 and blue=0xd0\n");
printf(" -noalpha ............... discard any transparency information\n");
printf(" -lossless .............. encode image losslessly\n");
#ifdef WEBP_EXPERIMENTAL_FEATURES
printf(" -near_lossless ......... use near-lossless image\n"
" preprocessing (0=off..100)\n");
#endif
printf(" -hint <string> ......... specify image characteristics hint,\n");
printf(" one of: photo, picture or graph\n");
@ -765,6 +769,9 @@ int main(int argc, const char *argv[]) {
keep_alpha = 0;
} else if (!strcmp(argv[c], "-lossless")) {
config.lossless = 1;
} else if (!strcmp(argv[c], "-near_lossless") && c < argc - 1) {
config.near_lossless = strtol(argv[++c], NULL, 0);
config.lossless = 1; // use near-lossless only with lossless
} else if (!strcmp(argv[c], "-hint") && c < argc - 1) {
++c;
if (!strcmp(argv[c], "photo")) {