AGIF with local palettes & interframe transparency
Posted: Wed Dec 31, 2008 11:45 pm
What the following animated GIFs have in common is a combination of frames with local palettes and interframe transparency:
- doesn't show animated gif correctly » ToHeart2_omake.GIF
- Bad GIF implementation » tc217.gif
- Playback of optimized GIF animations » job100_1.gif
- Problème gif animé » anime802.gif
- cancer.gif | color.gif | comet.gif | piggybank animation.gif | secours.gif | swirl1.gif | visualc.gif
- chainroll.gif | constructionspin.gif | lips1.gif | modem1.gif | pfennig01.gif | saucer1.gif | tskull.gif
About.com (Graphics Software » [url=http://graphicssoft.about.com/od/aboutgraphics/l/aaoptimizegifs.htm]Optimizing Animated GIFs[/url]) wrote:Some GIF animation/optimization software includes a feature that compares each frame to the previous frame and discards any pixels that do not change across frames. With this feature you can significantly reduce the size of an animation that includes repeating elements. Keep this in mind when you are designing your animation; the more pixels that change from frame to frame, the larger your animation is going to be.
Dr. Dobb's Journal ([url=http://www.ddj.com/184412988]Optimizing GIF Animations[/url]) wrote:“Dirty Rectangle” optimization
Dirty Rectangle optimization refers to a mode of optimization that involves cropping frames in a GIF animation to their smallest needed rectangle. These frames are then placed on top of each other using pixel coordinates for placement.
Interframe transparency optimization
Another way to optimize an animation is to make redundant portions of animation frames transparent. This often, but not always, results in file size savings. This is done by using two features in the GIF file format: transparency and disposal methods. Some colors in a GIF file can be made transparent, allowing the background image or color to show through them. The same is true for frames in an animation — if parts of the frames are transparent, they show through to any other frames behind them. This is referred to as “Interframe Transparency” (some GIF animation utilities refer to it as “Frame Differencing”).
GraphicsOptimization ([url=http://www.graphicsoptimization.com/diy/filetypes/animatedgif.htm]Optimizing animated .gif Imagery[/url]) wrote:
- Minimize the bounding rectangle for the changed pixels in your animation.
One can achieve a substantial amount of frame optimization by minimizing the bounding rectangle within an animated .gif file to include only the areas which are being altered as a part of the animated presentation.
- Apply interframe transparency optimization to the file.
Several software tools in the marketplace will allow designers to save only the pixels that have changed from frame to frame within an animated .gif file, also occasionally referred to as “frame differencing,” which can help to achieve a substantial amount of file size savings.
WebReference.com (Optimizing Animated GIFs » [url=http://www.webreference.com/dev/gifanim/crop.html]Crop with Frame Optimization[/url]) wrote:The GIF89a spec includes position values for each frame, so smaller frames can be positioned inside the animation. You can use this option is to create the illusion of movement of a static object, for example a football floating by. You can specify the position within the animation of the rectangle that bounds only the football.
Frame positioning also lets you isolate the elements that change from frame to frame, and position them within the animation. GIFBuilder's “frame optimization” feature automatically crops away the non-changing areas in all but the first frame and keeps the rectangle that bounds the area(s) that change. The first frame acts as a background, and subsequent smaller frames layer over it. The resulting file can be dramatically smaller, as you aren't storing the entire frame, just the part that changes.
Combining frame optimization with the frame differencing stores only the pixels that actually change. I found that using the full-frame differences and letting GIFBuilder do the cropping and positioning was the best way to retain registration.