spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / web / dev / gifanim / backgd
intro ->backgroundcolor palettesframe optimization
resultstutorialreduce paletteframe differencing
set optionscroptweakconclusions

Background and Foreground

Optimizing Animated GIFs

Figure 4: Cool Central Home Page
Cool Central

When we designed Cool Central, we wanted an eye-catching look with lots of movement, but fast download times. We settled on a goal of 30Kb total per page. We decided on a single visual theme, an iceberg, with melted portholes showing movement outside the berg; see Figure 4. The first two pages of Cool Central have four animations, a static logo, and a seamless background "ice" JPEG. By feathering our foreground graphics we were able to make the background graphic appear as the foreground, and the foreground graphics appear as the background (got that?). After countless hours of tweaking we finally got the seamless appearance we wanted, but without the long download times associated with large one-screen graphics. After deducting for our 1.2K background and the 4K of text we realized we would have make each GIF no greater that 5K in file size.

Penguin on a low-pixel diet

In conventional GIF animation, each additional full-size frame adds a significant percentage to the file size ((1/number of frames)*100). With seven frames, our mascot penguin took 21Kb (Figure 1) and waddled across the screen. In order to meet our goal of no more than 5K per animation we had to find a way to cut the file size by more than a factor of four.

The secret of shrinking animated GIFs is to save only the parts of the animation that change from frame to frame.

Since animated GIFs are essentially multiple GIFs with timing and transparency information, the same optimization principles apply: minimize colors and maximize crop. The secret of shrinking animated GIFs is to save only the parts of the animation that change from frame to frame. By overlaying these changes on an initial full-sized "backdrop" frame you can create animations that appear identical to the full-frame version but are dramatically smaller.

Minimize Key Frames

What you end up with is an initial full-sized "key" frame and several "motion" frames. This is a well-established technique used in game animation. Once you crop the motion frames, they become a much smaller percentage of the file's size. In our case the key frame is 2948 bytes, while the motion frames range from 395 to 629 bytes. Strategically, there's more to gain by optimizing the 3000 byte key frame than the six motion frames, unless there are a lot of motion frames. So you can see the importance of minimizing the color palette and complexity of the initial frame.

What distinguishes the different animation programs is how efficiently they handle color palettes and frame changes. First we'll reduce the color palette, then we'll concentrate on paring the pixels per pane.

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

intro ->backgroundcolor palettesframe optimization
resultstutorialreduce paletteframe differencing
set optionscroptweakconclusions

Comments are welcome

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Crucial Triples Up With New Three-Channel DDR3 Kits · Meet the Finalists: Excellence in Technology Awards · Tealeaf Offers Insight to Mobile Customer Behavior


Created: Apr. 28, 1997
Revised: Aug. 16, 1997

URL: http://webreference.com/dev/gifanim/backgd.html