Reddish color bleed on some WebP images
Found in image-webp v0.2.0
Input: 1600195945.webp.gz
imagemagick result:
image-webp result:
Note the reddish area in the bottom right corner of the image-webp output.
Same versions and reproduction code as in https://github.com/image-rs/image-webp/issues/117
~~Another image triggering this: magicountry_20210418221542.webp.gz~~ that's #142
Does this still happen?
Yes, this is still a problem as of v0.2.2
On 1600195945.webp the biggest divergence is block-shaped:
So we can rule out issues with loop filter and narrow it down to code that operates on blocks.
The 8x8 discoloration in the bottom right corner points to an issue with a chroma block. Something like intra prediction not processing the last block correctly, or residue coding not being applied to the last block.
For a 4:2:0 image, this would code for 24x24 luma pixels and 12x12 chroma pixels. With chroma macroblocks being 8x8, this means we have a 8x8 block, a partial 8x4 block, a partial 4x8 block, and the final 4x4 block which is the problematic one. The whole block is still coded but only a quarter of it is visible; it's likely that we're hitting some edge case in that scenario.
When taking #142 into account and comparing against dwebp -nofancy, all the divergence is clearly isolated to the last block: