mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-18 23:09:52 +02:00
add alpha dithering for lossy
new options: dwebp -alpha_dither vwebp -noalphadither When the source was marked as quantized, we use a threshold-averaging filter to smooth the decoded alpha plane. Note: this option forces the decoding of alpha data in one pass, and might slow the decoding a bit. The new field in WebPDecoderOptions struct is 'alpha_dithering_strength' (0 by default, means: off). Max strength value is '100'. Change-Id: I218e21af96360d4781587fede95f8ea4e2b7287a
This commit is contained in:
@ -177,6 +177,13 @@ void VP8InitDithering(const WebPDecoderOptions* const options,
|
||||
dec->dither_ = 1;
|
||||
}
|
||||
}
|
||||
// potentially allow alpha dithering
|
||||
dec->alpha_dithering_ = options->alpha_dithering_strength;
|
||||
if (dec->alpha_dithering_ > 100) {
|
||||
dec->alpha_dithering_ = 100;
|
||||
} else if (dec->alpha_dithering_ < 0) {
|
||||
dec->alpha_dithering_ = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user