Web Site Optimization: How To Speed Up Your Web Site By Minimizing Your GIF and PNG Image Bit-Depth

Are bloated images slowing down your web site and causing you lost business? Images comprise over 50% of the average web page so putting them on a diet is essential to improving web performance. One of the best ways to optimize GIFs and PNGs is to minimize the "bit-depth" or the number of colors within your images.

For palette-based formats like GIF and PNG, file size is directly related to the size of the color palette, or the number of colors in the image. As the number of colors in an image crosses a power of two, the file size jumps. A 33-color image must use a six-bit palette, while a 32-color image can use a 5-bit palette. Smaller palettes mean smaller codes (representing pixel patterns), which makes for smaller files. So minimizing the number of colors in index-color images like GIFs and PNGs will minimize file size.

The compression schemes used in GIFs (LZW) and PNGs (Deflate) are dictionary-based encoding algorithms. Dictionary based compression algorithms substitute shorter codes for longer patterns of strings within the data stream. Pixel patterns (substrings) in the data stream found in the dictionary are replaced with a single code. If a substring is not found in the dictionary, a new code is created and added to the dictionary. Compression is achieved when smaller codes are substituted for longer patterns of data.

The code size is based on the number of bits per pixel, and depends on the maximum length code within your dictionary. Thus the smaller your bit-depth, the smaller the codes representing your pixel pattern strings, and the smaller the file.

Choosing the right format for your images is the first step in optimizing web graphics. At lower bit-depths, banding can appear in smooth-toned images. Try quantizing your image to different palettes to minimize banding.

PNG Compression

PNG uses the deflate compression algorithm which is a newer, more efficient cousin of LZW. Deflate is designed to be free of patent problems. Deflate is a combination of the LZ77 algorithm found in zip programs like WinZIP and gzip, and Huffman coding. Deflate typically compresses files 20 to 30 percent smaller than LZW, which is the difference you'll find between gzip and compress. PNGs use a similar substitution technique, but are generally 5 to 25 percent smaller than GIFs, although there are exceptions. In addition to horizontal "scan-line" pattern substitution PNGs sometimes substitute for vertical patterns. PNG can also truncate color palettes. In general, the smaller the color palette, the smaller the overal file size.

Conclusion

To minimize the file size of palette-based image formats like GIF and PNG, minimize their bit-depth, or number of colors. Each time you pass a power of two, file size jumps higher. By minimizing the number of colors, and maximizing the flat-color areas you will create smaller, more efficient images destined for the Web.

Further Reading:

LZW Data Compression


http://www.dogma.net/markn/articles/lzw/lzw.htm


Mark Nelson breaks down the LZW compression algorithm for Dr. Dobb's Journal of October 1989.

Multimedia: Use Lossy Compression for Smaller GIFs and PNGs http://www.dogma.net/markn/articles/lzw/lzw.htm


Lossy compression lets you squeeze more bytes out of your GIFs and PNGs. Lossy compression increases identical pixel patterns to improve compression in indexed-color images.

Multimedia: Use Weighted Optimization


http://www.dogma.net/markn/articles/lzw/lzw.htm


Weighted optimization or regional compression applies different degrees of compression to different areas of your image. By varying the quality within images you can improve file size.

Optimizing Web Graphics


http://www.dogma.net/markn/articles/lzw/lzw.htm


Chapter summary from Speed Up Your Site, shows how to correct, optimize, and compress images for minimum file size and maximum quality.

PNG Home Site


http://www.dogma.net/markn/articles/lzw/lzw.htm


Greg Roelofs site devoted to all things PNG.

About The Author

Article by Andy King, author of the popular new book titled "Speed Up Your Site ? Web Site Optimization". Visit Andy King's web site to learn the best Web Site Optimization practices for higher traffic and speed guaranteed. http://www.dogma.net/markn/articles/lzw/lzw.htm

executive chauffeured services Bradford .. Madison to Airport car
In The News:

Getting virus alerts on your iPhone? Tech expert Kurt “CyberGuy" Knutsson helps you learn how to handle fake scam alerts and boost security.
Tech expert Kurt “CyberGuy" Knutsson says opening emails is safe, but risks arise from interacting with links, attachments or HTML content.
Tech expert Kurt “CyberGuy" Knutsson reveals four signs of compromised Social Security numbers and offers five steps to protect yourself.
Tech expert Kurt “CyberGuy" Knutsson discusses how MAB Robotics' Honey Badger 4.0, a versatile robot, now walks underwater with amphibious skills.
An updated Android trojan called FakeCall hijacks bank calls. Tech expert Kurt “CyberGuy" Knutsson says Android phone manufacturers and Google need to step up their game on security.
The Massimo Modular E9 is a sleek, smart and comfy tiny home in 409 square feet. Tech expert Kurt “CyberGuy" Knutsson takes a closer look at what the future of housing might look like.
Every stock trader should consider a virtual private network to safeguard their trading, according to tech guru Kurt "CyberGuy" Knutsson.
Apple recently announced its new lineup of Macs and rolled out Apple Intelligence, its latest artificial intelligence-powered feature for its products.
A Swiss-engineered robot can climb ladders, showing why it's at the cutting edge of autonomous robotic solutions for harsh industrial settings.
Kurt "CyberGuy" Knutsson presents the cities targeted most by robocalls, why this is happening and what you can do about it to protect your privacy.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents
Kurt "CyberGuy" Knutsson shares tips and suggestions for how to get the best use out of the updated Calendar app available with the latest iOS update.
Your Social Security number, your unique identifier used for many purposes, has likely been leaked on the Dark Web; here are some steps you can take to protect yourself.
Researchers have developed a new technology that creates strong, sticky fibers capable of lifting objects and capturing things from a distance.
Smart rings track the same things that smartwatches do, including steps, sleep and a general overview of your overall health, and they tend have more battery life than smartwatches.
Researchers have developed a robotic finger that can perform routine medical exams like those conducted by doctors, helping to address the growing shortage of trained professionals.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Insurance administrative services company Landmark Admin reported that a data breach from a May cyberattack affected over 800,000 people.
Sotheby's will auction the first artwork created by Ai-Da, the world's first robot artist created in 2019 by British gallerist Aidan Meller.
More than 250 million users of the Verizon Messages app will have to switch to another app. Verizon is shutting down Messages in the next month.
Tech expert Kurt “CyberGuy" Knutsson provides a list of 10 celebrities who are the most targeted by deepfake scams, including Tom Hanks.
Tech expert Kurt “CyberGuy" Knutsson discusses how Vast's Haven-1, launching in 2025, transforms space living with human-centric design.
UnitedHealth confirms over 100 million Change Healthcare users had their data stolen. Kurt “CyberGuy" Knutsson reveals what happened and what caused the breach.
Tech expert Kurt “CyberGuy" Knutsson explains how iOS 18 brings new text formatting and animated effects to the Messages app.
Whether you're a social media veteran or novice, Facebook friend request scams are common. Kurt the CyberGuy provides tips to keep your account safe.

Profitable Websites for Exclusive Industries

In the region where my company is located, South Bend,... Read More

Preventing Repeat Form Submission Using PHP Sessions

We've all seen those messages on some websites warning not... Read More

How To Convert More Sales On Your Website

One of the biggest mistakes that most online retailers make... Read More

High Quality Website at Low Cost

Although designing a great web site is an important part... Read More

Ebooks for Webmasters

Internet has opened a whole new world for web developers... Read More

Art, Artists and the Web: Part 4--What to Do After a Website is Designed

What to do if you are an artist after you... Read More

Website Survival Guide

In the big, wide online world there are millions of... Read More

10 Tips For Running A Profitable Web Site

1. Address your targeted audience on your business site. Example:... Read More

1 Simple Solution to All Internet Marketers about Their Website Design Needs

It is an undeniable fact that not everybody is keen... Read More

How to Make Your Own Free Website in 8.5 Minutes or Less

Designing and creating your own website does not have to... Read More

Live Support from Your Website? Can You Do It for Free?

I'm a freelance programmer and somehow I managed to get... Read More

How to Handle Web Surfers Who Disabled JavaScript

There are hundreds of millions of Web surfers today. Each... Read More

Wheres Your Focus, Money or Customer?

Is your website Really useful?I had a 'rep' in yesterday... Read More

Web Coach Tip: What You Should Know About DIY Web Sites

Recently, a friend asked "What's the deal with those DIY... Read More

In Business? 10 Reasons Why You Need a Website -- Now!

1) Word of Mouth The single most powerful form of... Read More

Build It and They Will Come

Build it and they will come is not always true;... Read More

My Yahoo Search - Beyond Bookmarks

Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More

The 2 Most Common Web Site Mistakes

When we review the sites of potential clients, there are... Read More

10 Simple Steps: Its Magic If You can E-Mail You can Update Your Web Page Dynamically

Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More

What is Blogger.com?

In the late 1990's three San Francisco based web developers... Read More

Web Success Secret - Keep Your Visitors Interested

Visitors to your site come looking for information or solutions... Read More

Having a Domain Name And Web Site Gives Your Business The Key To The Door

Just like all things in life, the ways to run... Read More

I Want To Be A Freelancer

So you have decided that you want to do freelance... Read More

How to Listen on the Web

When building a relationship, listening is more important than talking.A... Read More

PHP & Account Activation

When a user signs up at your website, you may... Read More

O'Hare Chicago prom limo ..