summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLode Vandevenne <lode@google.com>2015-11-16 13:14:57 +0000
committerJames Zern <jzern@google.com>2015-11-21 12:32:32 -0800
commit1f9be97c22d991816cd72a9d83569d15dcf75965 (patch)
tree3af94fe1d2944bfc76bfdefdad9961c443c0f34c /examples
parentb37b0179c5a1fbecab13c7cd847b864d61da23c7 (diff)
downloadlibwebp-1f9be97c22d991816cd72a9d83569d15dcf75965.tar.gz
Make discarding invisible RGB values (cleanup alpha) the default.
Rename the flag to exact instead of the opposite cleanup_alpha. Add the flag to WebPConfig. Do the cleanup in the webp encoder library rather than the cwebp binary, this will be needed for the next stage: smarter alpha cleanup for better compression which cannot be done as a preprocessing due to depending on predictor choices in the encoder. Change-Id: I2fbf57f918a35f2da6186ef0b5d85e5fd0020eef
Diffstat (limited to 'examples')
-rw-r--r--examples/cwebp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/cwebp.c b/examples/cwebp.c
index 84547278..d7f8a7c0 100644
--- a/examples/cwebp.c
+++ b/examples/cwebp.c
@@ -611,7 +611,8 @@ static void HelpLong(void) {
printf(" -alpha_method <int> .... transparency-compression method (0..1)\n");
printf(" -alpha_filter <string> . predictive filtering for alpha plane,\n");
printf(" one of: none, fast (default) or best\n");
- printf(" -alpha_cleanup ......... clean RGB values in transparent area\n");
+ printf(" -exact ................. preserve RGB values in transparent area"
+ "\n");
printf(" -blend_alpha <hex> ..... blend colors against background color\n"
" expressed as RGB values written in\n"
" hexadecimal, e.g. 0xc0e0d0 for red=0xc0\n"
@@ -763,7 +764,10 @@ int main(int argc, const char *argv[]) {
} else if (!strcmp(argv[c], "-alpha_method") && c < argc - 1) {
config.alpha_compression = ExUtilGetInt(argv[++c], 0, &parse_error);
} else if (!strcmp(argv[c], "-alpha_cleanup")) {
- keep_alpha = keep_alpha ? 2 : 0;
+ // This flag is obsolete, does opposite of -exact.
+ config.exact = 0;
+ } else if (!strcmp(argv[c], "-exact")) {
+ config.exact = 1;
} else if (!strcmp(argv[c], "-blend_alpha") && c < argc - 1) {
blend_alpha = 1;
// background color is given in hex with an optional '0x' prefix
@@ -996,10 +1000,6 @@ int main(int argc, const char *argv[]) {
WebPBlendAlpha(&picture, background_color);
}
- if (keep_alpha == 2) {
- WebPCleanupTransparentArea(&picture);
- }
-
if (verbose) {
const double read_time = StopwatchReadAndReset(&stop_watch);
fprintf(stderr, "Time to read input: %.3fs\n", read_time);