GaseousStates / webp

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

gif2webp.exe does not support GIF_DISPOSE_RESTORE #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to convert Lal.gif to an animated webp with gif2webp
2. Get GIF_DISPOSE_RESTORE not supported during conversion
3. Resultant animated webp is incorrect

What is the expected output? What do you see instead?

The output webp animation is corrupt and does not render as the original.

What version of the product are you using? On what operating system?

gif2webp.exe 0.3.0rc6 on Windows XP service pack 3.

Please provide any additional information below.

Original issue reported on code.google.com by file.xtr...@gmail.com on 21 Mar 2013 at 9:35

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,
Thanks for the report!
Yes, this is a known limitation now.

*Reasoning:*
it was decided not to support "Restore to previous" in WebP format, as it 
imposes severe demands for the decoder/viewer.

To quote the recommendation in GIF spec 
(http://www.w3.org/Graphics/GIF/spec-gif89a.txt):

---
      e. Recommendations.

            i) Disposal Method - The mode Restore To Previous is intended to be
            used in small sections of the graphic; the use of this mode imposes
            severe demands on the decoder to store the section of the graphic
            that needs to be saved. For this reason, this mode should be used
            sparingly.  This mode is not intended to save an entire graphic or
            large areas of a graphic; when this is the case, the encoder should
            make every attempt to make the sections of the graphic to be
            restored be separate graphics in the data stream. In the case where
            a decoder is not capable of saving an area of a graphic marked as
            Restore To Previous, it is recommended that a decoder restore to
            the background color.
---

*Solution:*
Given that, it is still possible to exactly convert such a GIF image (which 
uses GIF_DISPOSE_RESTORE) to WebP exactly -- by preserving earlier frame(s) 
during conversion, and then creating WebP frames by blending previous and 
current frames. This would take more memory at conversion time, but would 
remain efficient at decode/viewing time.

This is in my TODO list.

Original comment by urv...@google.com on 21 Mar 2013 at 11:39

GoogleCodeExporter commented 9 years ago
Urvang: looks like we can now emulate this mode with latest util code, can't we?

Original comment by pascal.m...@gmail.com on 8 Oct 2013 at 1:08

GoogleCodeExporter commented 9 years ago
Sounds great, can retest this issue for the next release.

Original comment by file.xtr...@gmail.com on 8 Oct 2013 at 8:19

GoogleCodeExporter commented 9 years ago
Urvang, what's the status on this one?

Original comment by jz...@google.com on 18 Dec 2013 at 5:43

GoogleCodeExporter commented 9 years ago
This is a bit involved, but I have an idea that should work. I plan to work on 
it in near future.

Original comment by urv...@chromium.org on 19 Dec 2013 at 1:48

GoogleCodeExporter commented 9 years ago
I just added GIF_DISPOSE_RESTORE support in: 
https://gerrit.chromium.org/gerrit/#/c/71990/
(This will be submitted shortly).

Original comment by urv...@google.com on 23 Oct 2014 at 12:04