mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-14 21:09:55 +02:00
add WebPBlendAlpha() function to blend colors against background
new option: -blend_alpha 0xrrggbb also: don't force picture.use_argb value for lossless. Instead, delay the YUVA<->ARGB conversion till WebPEncode() is called. This make the blending more accurate when source is ARGB and lossy compression is used (YUVA). This has an effect on cropping/rescaling. E.g. for PNG, these are now done in ARGB colorspace instead of YUV when lossy compression is used. Change-Id: I18571f1b1179881737a8dbd23ad0aa8cddae3c6b
This commit is contained in:
@ -456,6 +456,11 @@ WEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture);
|
||||
// alpha plane can be ignored altogether e.g.).
|
||||
WEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture);
|
||||
|
||||
// Remove the transparency information (if present) by blending the color with
|
||||
// the background color 'background_rgb' (specified as 24bit RGB triplet).
|
||||
// After this call, all alpha values are reset to 0xff.
|
||||
WEBP_EXTERN(void) WebPBlendAlpha(WebPPicture* pic, uint32_t background_rgb);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Main call
|
||||
|
||||
|
Reference in New Issue
Block a user