spacer

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

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

Minimizing Color Palettes

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

Optimizing Animated GIFs

Bit Depth = Color Depth
Number of colors = 2^bit depth
Where bit depth = number of bits/pixel

Example: An image with a bit depth of 6 can have up to 64 colors (2^6=64)

Bit Depth Poss. Colors
12
24
38
416
532
664
7128
8256

Minimizing the color palette is a good and often overlooked way to reduce the file size of any type of GIF. GIF file size is directly related to bit depth, and decreases dramatically when you reduce by two bits or more. Think powers of two - if a palette is just above a power of two, say 66 colors, and you reduce it to 64, the file size will drop. This is due to how LZW, GIF's compression algorithm, encodes its data. The more potential colors a pixel can have (read size of global color palette), the larger the pixel's initial code size (in bits) and the larger the file (see the LZW section for details). Animated GIFs can have one global palette or multiple local palettes attached to each image. Unless you have widely changing colors from frame to frame, it's a good idea to stick with an optimized global palette.

When you use local palettes, Netscape 3 and below has a bug that causes a "flicker" effect. Netscape loads the local palette for the next image while the current image is still displayed. If they don't use a majority of the same colors, you'll see a flicker when the image remaps. To avoid this, you can either use BoxTop's GIFMation 1.0 (if you can find it), which automatically creates a hybrid palette that contains the local palettes of the two frames or create an optimized global palette. You can do this by hand or use a program that creates optimized global palettes automatically: GIFMation, HVS ColorGIF, Ulead's GIF Animator, GIF Wizard, or DeBabelizer.

SuperPalette

DeBabelizer goes a step further, and can automatically create a SuperPalette (TM) from a series of images. The SuperPalette is a proprietary file format by Equilibrium that polls colors in a series of files and uses the most common colors to create an optimum global palette. The neat thing about Debab's SuperPalette is that it can dynamically regenerate itself after you add more images and palettes, giving you the optimum global palette every time. Note that Netscape claims this local palette remapping bug was fixed in version 4.0.

I hand-tuned my palette with DeBabelizer using the most colorful frame as a foundation, removing and merging unused and close colors, and using these same colors for my lettering. From my full color Photoshop file, I trimmed my palette down to 22 colors, but in retrospect a simpler ice pattern would have given us better compression for the first frame.

Nondithering Colors

There is a 216-color palette that does not dither on 8-bit Macs and PCs. (see Optimizing Web Graphics for details). It's a good idea to use these colors in your animations, but this isn't always possible. Since our penguin animation has both continuous-tone and flat areas we used a hybrid approach. For the flat sky, water, and penguin we chose colors from the nondithering palette and reduced the image in DeBabelizer, which doesn't shift colors as Photoshop can.


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. 16, 1997
Revised: Oct. 18, 1999

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