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

Beecher limo rentals ..
In The News:

Kurt “CyberGuy" Knutsson goes into detail about Apple’s recent iOS update that allows iPhone users to instantly translate spoken language simply by using the Action Button.
Safeguarding your digital life with a reliable physical backup isn't just a precaution, it's a necessity. Kurt “CyberGuy" Knutsson provides the essential backup checklist.
Kurt “CyberGuy" Knutsson reveals how a Redditor exposed false recycling claims at their apartment, highlighting a report that only 21% of U.S. recyclables are processed.
Kurt "CyberGuy" Knutsson offers a travel toolkit featuring five technology tools to help you with booking flights and hotels for your summer vacation.
The bubble behind the clock on your iPhone can appear in different colors. Kurt "CyberGuy" Knutsson explains what each of those colors mean.
Scammers are using the power of artificial intelligence to mimic voices of people and are using the fake voices to commit crimes, like kidnappings.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Tech guru Kurt "CyberGuy" Knutsson explains the science behind the Invisibility Shield, a 6-foot shield that makes people become invisible.
The International Olympic Committee on Friday announced plans to use AI in various Olympic aspects, including athlete identification, training and judging.
Tech guru Kurt "CyberGuy" Knutsson explains an easy trick to avoid squinting while working or surfing the web by zooming in on your personal computer.
Streaming giant Roku has recently been targeted by a pair of cyberattacks, and the company confirmed over a half million Roku accounts were compromised.
The Land Aircraft Carrier combines an all-terrain, six-wheeled vehicle with a two-seat aircraft, which features electric vertical takeoff and landing.
The European Union has sent TikTok a "request for information" on the video sharing platform's newest app, TikTok Lite, under the Digital Services Act, with the aim to clean up social media.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
The FBI is warning the public about a recent phishing scam via text that claims its targets owe money in Pennsylvania for unpaid road toll charges.
Your Apple Music settings may be revealing to your contacts what you're listening to. Kurt "CyberGuy" Knutsson explains the process to change those settings.
Learn how to secure social media accounts, implement legacy contacts, and create a digital estate plan to protect your online assets from 'ghost hackers' after your death.
A ported phone number scam is leading to more people having their identities stolen by sophisticated scammers. Kurt “CyberGuy" Knutsson tells you what you need to know.
The Great Pacific Garbage Patch, a vast marine debris vortex, is being tackled by The Ocean Cleanup’s innovative technologies. Kurt “CyberGuy" Knutsson explains.
Discover easy solutions to tame autocorrect frustration on iOS and Android devices. Turn off, customize and add personal touches to your typing experience.
Kurt “CyberGuy" Knutsson reveals the six top things to do right now before it’s too late: Tech and life choices that can keep your safer on and offline.
Kurt “CyberGuy" Knutsson shows you some simple steps to discreetly hide apps or an entire app page on your iPhone for decluttering or confidentiality.
The ambient light sensors on smartphones may be turned into cameras, according to researches at MIT. This could pose a threat to people's privacy.
The Autonomous Road Repair System from tech firm Robotiz3d uses artificial intelligence technology to locate potholes and promptly seal them.
Scammers have stooped to using artificial intelligence to scan obituary websites to create fake obituary websites to target the grieving.

How To Keep Your Website Sticky

Developing a website with content that entices visitors to return... Read More

Why to Have a Website for Your Company

After having decided to start a business, the next thing... Read More

Whats Your Business Online Attitude?

This article was prompted by some customer support work I... Read More

Website Survival Guide

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

Ten Quick Tests To Check Your Website For Accessibility

The Disability Discrimination Act says that websites must be made... Read More

Get a Website!, Register Your Domain!: To Website or Not to Website?

If you're fairly new to the Internet scene, you may... Read More

How to Get a Knock Out Website!

The first step in setting up an online business...Starting an... Read More

Beware the Software Siren

I've heard several prominent web marketers mention in their classes... Read More

Lead Generation How to -- 10 Tips On Generating More Internet Sales Leads

Many millions of dollars are being wasted on promoting and... Read More

Making Your Websites More Compelling

The Internet is a remarkable publishing medium. With just a... Read More

Frequent Business Question: How Do You Start a Web Business?

Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More

10 Things You Should Be Monitoring On Your Website

Every business needs to know how it is doing. That's... Read More

The Disability Discrimination Act (DDA) & Web Accessibility

There's been widespread speculation about the new legislation being introduced... Read More

5 Essential Traits Of A Home Business Website

So you've decided to start an online work at home... Read More

Effectively Using Robots Meta Tags

The "robots" meta tag, when used properly, will tell the... Read More

Maintaining Your Business Website

QUESTION: Should I build and maintain my business Web... Read More

How To Evaluate Your Web Sites Performance

Setting up a website is the very first step of... Read More

What ROI You Should Expect From Your Web Site

Is Your Web Site an Expense or an Investment?Why don't... Read More

Five Reasons You Have to Stop Your Web Site

That's right. Your method, behavior and strategy you are now... Read More

Making The Business Case For Web Standards

Through the explosive growth of the Web, companies have realized... Read More

High Quality Website at Low Cost

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

MySQL Database Handling in PHP

Most interactive websites nowadays require data to be presented dynamically... Read More

How to Listen on the Web

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

Benefits Of Making Your Website Accessible To Disabled Users ? Part 2: The Business Case

The Disability Discrimination Act states that service providers must not... Read More

You Need To Treat Your Website Like An Employee - Heres 5 Ways To Do It

People often come to me in a state of crisis... Read More

Bridgeview limo Chicago ..