5 ms·
Can you show an example of an animation with more than 256 colors? As you said, the hack to get more than 256 colors is to redefine a sub rectangle with a new
by ux 12y ago
Can you show an example of an animation with more than 256 colors?
As you said, the hack to get more than 256 colors is to redefine a sub rectangle with a new palette. But that's also the mechanism used to make animations. Are you able to get fluid playback with that?
Note: I'm not talking about new frame being just a new sub rectangle, more about N sub rectangles for the same frame, then a delay event, then M sub rectangles for the new frame, etc
- 1ris 12y agoNone that works with current browsers implantations, because they erroneous ignore no delay between frames and wait anyway. But that's a bug in the gif decoder, not a limitation of gif. OK, this is hairsplitting, but it illustrates how borken the state of gif is.
- eridius 12y agoMaybe someone who cares about this should submit patches? All of the major browser engines are open-source.
- chc 12y agoThis would probably cause regressions with other GIFs that neglect to specify a delay but are supposed to have one. It's hard to imagine this universal behavior is accidental. It's probably like everything else on the Web — a hack to keep things that shouldn't work from actually not working.
- wzdd 12y agoI'm fairly sure that the reason for this universal behaviour is that there are plenty of broken, looping gifs out there with inter-frame delays of 0. I used a version of Konqueror which would spin at 100% of a core when it encountered one of these. A better hack (but it's still a hack) might be to wait one frame (or longer) before returning to the beginning of a looping gif. Given that this would be significantly harder than the current approach (which is apparently either delay = max(delay, 16ms) or if(delay < 16) delay = 100) and the only reason for it would be to support this pretty-niche multi-palette composited-frame thing, it seems like it would be hard to argue for.
- eridius 12y agoAre there GIFs that specify a delay on some frames but not others, and expect all frames to have a delay? Because it should be easy to detect animated GIFs that specify no delay for any frame, and treat them all as having a delay.
- chc 12y agoAs I understand it, that would still block this "large-palette GIF" trick, because those would also consist entirely of frames with no delay.
- eridius 12y agoI assumed that the "large-palette GIF" would have animation. Otherwise, why are you bothering with tricky GIFs at all, why not just use a PNG (or JPEG, depending on the image type)?
- neolefty 12y agoA workaround for the workaround: for a high-color gif, add a blank "animation" frame at the end that has a delay, after all the no-delay buildup elements. However, that's unlikely to be necessary because if you are just doing a high-color image with no animation, you may as well use JPEG or PNG.
- mbrubeck 12y ago> All of the major browser engines are open-source. In a world where Internet Explorer is not a major browser.
- eridius 12y agoHah, I can't believe I actually forgot Internet Explorer was still around. Good point.
- ChrisLomont 12y agoActually, regarding the delay, the spec reads "vii) Delay Time - If not 0, this field specifies the number of hundredths (1/100) of a second to wait before continuing with the processing of the Data Stream. " A zero delay is most certainly not covered by the spec, and anyone using one is creating GIFs that do not meet the spec. [0] http://www.w3.org/Graphics/GIF/spec-gif89a.txt http://www.w3.org/Graphics/GIF/spec-gif89a.txt
- bbllee 12y agoYou can achieve no delay without using a zero delay. Graphic Control Extension blocks may be omitted between images and so multiple images can come in a row without anything defining a delay between them. See the last instance of the phrase "graphic control" in the document to see that multiple images can come with no intervening GCE blocks and see the paragraph containing the 5th instance of that phrase to observe that a GCE block only affects the first image following the GCE.