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
(cherry picked from commit e7d9548c9b
)
This commit is contained in:
committed by
James Zern
parent
bc9f5fbe0f
commit
dcbb1ca54a
@ -98,6 +98,7 @@ int ReadTIFF(const char* const filename,
|
||||
#ifdef __BIG_ENDIAN__
|
||||
TIFFSwabArrayOfLong(raster, width * height);
|
||||
#endif
|
||||
pic->use_argb = 1;
|
||||
ok = keep_alpha
|
||||
? WebPPictureImportRGBA(pic, (const uint8_t*)raster, stride)
|
||||
: WebPPictureImportRGBX(pic, (const uint8_t*)raster, stride);
|
||||
|
Reference in New Issue
Block a user