Status: New Owner: ---- Labels: Type-Defect Priority-Medium New issue 287 by maxste...@gmail.com: Lossy gif2webp creates weird artifacts https://bugs.chromium.org/p/webp/issues/detail?id=287 What steps will reproduce the problem? 1. Download GIF from https://dribbble.com/shots/2389999-Trefoil 2. gif2webp -lossy trefoil.gif -o trefoil_lossy.webp 3. Playing the result in browser, you'll notice at the bottom of the figure some blue horizontal lines flickering. What is the expected output? What do you see instead? Some artifacts are expected in lossy conversion, but those horizontal lines are too weird. Seems like a bug. What version of the product are you using? 0.5.0 Please provide any additional information below. webpmux -get frame 15 trefoil_lossy.webp -o frame15.webp After extracting the frame with the command ^^^ above, it's clear that fully transparent areas are filled with some artificial RGB values, probably to help with the compression. That's ok for invisible alpha=0 areas. But those RGB values seems to spill over into visible alpha=255 areas too. See the attached screenshots. Attachments: Animation_in_chrome_crop4x.png 46.0 KB RGB_frame15_crop4x.png 42.3 KB RGBA_frame15_crop4x.png 37.1 KB -- You received this message because: 1. The project was configured to send all issue notifications to this address You may adjust your notification preferences at: https://bugs.chromium.org/hosting/settings
Updates: Status: Accepted Comment #1 on issue 287 by urv...@google.com: Lossy gif2webp creates weird artifacts https://bugs.chromium.org/p/webp/issues/detail?id=287#c1 Thanks for the report! I can reproduce the problem. Let me investigate. -- You received this message because: 1. The project was configured to send all issue notifications to this address You may adjust your notification preferences at: https://bugs.chromium.org/hosting/settings
Comment #2 on issue 287 by pascal.m...@gmail.com: Lossy gif2webp creates weird artifacts https://bugs.chromium.org/p/webp/issues/detail?id=287#c2 It seems the various *source* frames have been preprocessed to reduce their individual palette to ~100 colors. It also means that the delta between two subsequent frames has a lot of 'dust' that comes from the per-frame quantization (see attached frame diff). Not only is this dust 'hard' to compress (lossless or lossy mode), but it also produces trails and artifact in the lossy mode. We probably need some option to apply temporal smoothing, that would undo the quantization and remove the dust (for better compressibility!). Attachments: diff_frame_1_2.png 17.2 KB -- You received this message because: 1. The project was configured to send all issue notifications to this address You may adjust your notification preferences at: https://bugs.chromium.org/hosting/settings
Comment #3 on issue 287 by maxste...@gmail.com: Lossy gif2webp creates weird artifacts https://bugs.chromium.org/p/webp/issues/detail?id=287#c3 Yes, that might help. But please investigate the blurring too. The function below seems to fill those transparent 8x8 blocks with solid 'average' color, yet in the 2nd screenshot you see that some of the blocks are blurry, and it even spills over opaque pixels nearby. // Replace similar blocks of pixels by a 'see-through' transparent block // with uniform average color. static void FlattenSimilarBlocks(const WebPPicture* const src, const FrameRect* const rect, WebPPicture* const dst) { ... } -- You received this message because: 1. The project was configured to send all issue notifications to this address You may adjust your notification preferences at: https://bugs.chromium.org/hosting/settings