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

Wood Dale Chicago prom limo .. Lockport Chicago limo O’Hare
In The News:

Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents
Internet browsers are useful, but they can be dangerous. Clicking on malicious links can direct you to dangerous websites that steal information or infect your device.
Apple's latest iOS update introduces advanced artificial intelligence capabilities, which may be capturing and analyzing sensitive information.
Breach site confirmed 56,904,909 Hot Topic users' data leaked online. Tech expert Kurt “CyberGuy" Knutsson says the company's silence makes matters even worse.
Tech expert Kurt “CyberGuy" Knutsson discusses how an innovative Easy-Way kit turns standard strollers electric, simplifying navigation for parents.
Tech expert Kurt “CyberGuy" Knutsson talks about T-Mobile being hacked in broad cyberattack on global phone and internet companies.
Tech expert Kurt “CyberGuy" Knutsson shows you how to add, customize and manage widgets for quick access to apps and info from your iPhone home screen.
Wrong Google searches can not only compromise your device and personal data. They can also bring law enforcement to your doorstep. Hackers are targeting Google searches.
China's Shanghai Kepler Robotics has developed a new humanoid robot that can carry up to 35 pounds per hand for commercial applications across various industries
Checking your hearing has gotten easier with the new hearing test feature in AirPods Pro 2. You can take reliable hearing tests using your iPhone or iPad.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Kurt "CyberGuy" Knutsson explains how a VPN — virtual private network — works and how running it can slow down the operation of your device.
The WalkON Suit F1, an exoskeleton developed to help people with disabilities, can actually walk over to a person in a wheelchair, solving a major problem.
ClickFix, a new scam targeting computer users, is on the rise in the U.S. The scam prompts its targets to click on a link to fix a problem.
Skydweller is the world's largest unmanned solar-powered aircraft that can stay airborne for weeks, and even months, without refueling.
The U.S. government said it is investigating after People's Republic of China hackers targeted commercial telecommunications service providers in the U.S.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Scammers are using increasingly sophisticated ways to lure unsuspecting victims, and some are impersonating an email help desk or support team.
You can unsend or edit your iMessages with the latest iOS updates. Kurt the CyberGuy explains how you can save yourself some potential embarrassment.
Kurt “CyberGuy" Knutsson says there’s been a rise in cybercriminal services using hacked police and government emails to send subpoenas and data requests to U.S. companies.
Kurt “CyberGuy" Knutsson discusses how Axiom Space and luxury designer Prada are collaborating on NASA's Artemis III spacesuit design.
Voice assistants may cause confusion across devices. Tech expert Kurt “CyberGuy" Knutsson offers some solutions to fix it.
Shameless scammers trick veterans into giving personal info or cash. Tech expert Kurt “CyberGuy" Knutsson explores five common scams.
Tech expert Kurt “CyberGuy" Knutsson helps you honor our heroes with these powerful podcasts, audiobooks and documentaries this Veterans Day.

Your Future Profit Is In The Stars

You don't believe in astrology but you check your horoscope... Read More

Getting One-way Inbound Links: the 5 Major Strategies

With search engines putting a damper on direct reciprocal links,... 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

Achieving Differentiation With Your Website

Internet Marketing is not a miracle marketing strategy ? competition... Read More

Where on Earth is Your Websitee?

You've just finished congratulating your marketing team. After six months... Read More

Learn to Build a Better Online Business Website Using Keywords and Content

Are you aware that 90% of the websites on the... Read More

I Want To Be A Freelancer

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

Flash Deadly Sins (That Can Kill Your Web Business)

Looks like every client wants a Flash site these days... Read More

MySQL Database Handling in PHP

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

Why Is No-one Buying From My Website?

Are you, like many other website owners, frustrated at the... Read More

3 Essential Tools Every Website Designer and Marketer Needs

Appealing to others is really important when you have a... Read More

Your Content for Nothing and Your Clicks for Free

The first thing my business consultant (read brother-in-law) asked me,... Read More

How Web Templates Are Helping Online Businesses to MultiplyTheir Income

Web templates by nature are created to aid and ease... Read More

Whats Your Business Online Attitude?

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

Running An Effective Website

Running an effective website is a continuous process. I have... Read More

You Need a Website!

No matter the size of your business, having a web... Read More

Building eCommerce Websites that Work - Part 3

An interesting eCommerce success factor that isn't precisely overlooked, but... Read More

You May Be Losing Valuable Traffic - And Not Even Know It!

Here's something you may never have thought of before:If I... Read More

Is Your Website Doomed for Failure Before Youve Built It?

One of the things that many people overlook when building... Read More

Get Your Business on the Web

I can't think of any business alive today that couldn't... Read More

Successful Web Development: 10 Key Elements

There are many elements that are key to successful web... Read More

Web Designer? You Dont Need No Stinkin Web Designer!

RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More

Building a Web Store on Shoestring Budget in less than Four Hours

Starting a business online is no longer as difficult as... Read More

Marketing Your Business Online

As a business you can't afford to ignore the Internet... Read More

Your Biggest Mistake When You Create a Website?

--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More

Antigo wedding limo ..