qiqian / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

inaccurate interpolation of transparent images during rescaling #160

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Image with sharp alpha mask and sharp color transition underneath
may generate inaccurately averaged pixels when rescaling (both encoding and 
decoding).

How to reproduce (<= 0.3.1):

encoding: cwebp eff.png -resize 1000 697 -o eff.webp

decoding: cwebp eff.png -o eff.webp && dwebp eff.webp -o eff2.png -scale 1000 
697

Reason: for rescaling with alpha, we must use pre-multiplied color values, 
instead of original ones.

reported by Jonathan (<jonathanrichardong@gmail.com>)

Original issue reported on code.google.com by pascal.m...@gmail.com on 16 Jul 2013 at 2:16

Attachments:

GoogleCodeExporter commented 8 years ago
https://gerrit.chromium.org/gerrit/#/c/63485/ has been submitted to address the 
issue for encoding (lossy + lossless) and decoding (only lossless for now).

Decoding of lossy is trickier (since it's working in YUV/A colorspace) and will 
require extra work.

Original comment by pascal.m...@gmail.com on 26 Jul 2013 at 7:13

GoogleCodeExporter commented 8 years ago
https://gerrit.chromium.org/gerrit/#/c/70292/ was the last of serie
that fixed all the alpha-rescaling problems.

Should work ok now in all scenarios and combinations: compress from YUVA, 
compress
from RGBA, decompress to YUVA, decompress to RGBA, lossy, lossless, etc.

Original comment by pascal.m...@gmail.com on 15 Aug 2014 at 7:45