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

apartment cleaning near Wilmette ..
In The News:

Public voter records expose retirees' personal details to election scammers who create targeted cons using names, addresses, and voting history data.
Instead of fearing what comes next with artificial intelligence, think outside the box. Here are high-earning AI jobs that don't require a computer science degree.
OpenAI CEO Sam Altman says polite words like "please" and "thank you" cost millions annually, while direct prompts may improve ChatGPT accuracy by several points.
Chattee Chat and GiMe Chat exposed intimate conversations and photos, revealing users spent up to $18,000 on AI companions before the breach.
New Instagram parental controls allow families to manage teen screen time and content limits through the Family Center with stricter safety settings.
Third-party security breach at Discord exposes sensitive user information including government IDs, highlighting cybersecurity risks from external service providers.
Survey of 1,000 students shows teens using AI for personal relationships while two-thirds of parents remain unaware of their children's AI usage.
Cybersecurity experts warn about a ShadowLeak vulnerability that weaponized ChatGPT's Deep Research agent to steal personal data from Gmail accounts through hidden commands.
Tesla's Full Self-Driving system faces federal investigation following 58 reports of crashes, with six vehicles running red lights before colliding with other cars.
The Fox News AI Newsletter brings you the latest developments on artificial intelligence, with news on OpenAI moving to soon allow erotica for adult users.
Eric Schmidt alerts that hackers can reverse-engineer AI models to bypass safety measures, citing examples like the jailbroken ChatGPT variant called DAN.
Cybercriminals exploit Microsoft Teams through impersonation, malicious links and fake profiles to gather intel and deliver ransomware to personal and work devices.
Google, Dior, Allianz and dozens of other companies lost sensitive customer data in Salesforce-related breaches affecting millions of records across multiple sectors.
Apple launches iOS 26 with new Preview app that combines document editing, PDF annotation and scanning features into one streamlined iPhone experience.
New AI road monitoring system uses sensor-embedded fabric to predict infrastructure problems, potentially reducing maintenance costs and traffic disruptions for cities.
Holiday charity scams target retirees through lookalike organization names, untraceable payment requests, and data broker information to steal donations.
The Federal Trade Commission says criminals are posing as IRS agents, law enforcement officers or other officials, often over the phone or online, to steal thousands of dollars at a time.
AI phishing scams now use voice cloning and deepfake technology to trick victims, but Kurt "CyberGuy" Knutsson reveals warning signs to watch for.
Inversion Space unveils Arc, a reusable reentry vehicle that can deliver up to 500 pounds of cargo from orbit to anywhere on Earth in under an hour.
Red flags like processing fees, urgent countdowns and requests for full Social Security numbers expose fraudulent settlement sites targeting consumers.
Comprehensive analysis of Google Maps, Waze and Apple Maps examines usability, routing accuracy, data handling and features across the top navigation platforms.
Expert analysis reveals whether wired Ethernet or wireless Wi-Fi connections are safer for home internet use, plus practical steps to secure your network from attackers.
Australian construction robot Charlotte uses sand, crushed brick and recycled glass to 3D print fireproof, floodproof homes with reduced carbon footprint.
Cybercriminals are using fake invitation emails to trick recipients into downloading malware and stealing personal information and data.
Flying drones could help retailers fight a 93% increase in theft rates as Flock Safety promotes airborne security systems to track suspects and deter crime.

Free Websites & Why You Should Avoid Them

It amazes me how many people try to build serious... Read More

Allocating Your Web Site?s Budget Properly

I had a client say something to me the other... Read More

The Importance of Website Stats to You

One of the best tools you have as a webmaster... Read More

Making Your Website Shine! Attract and Keep Visitors at Your Site!

When you consider the billions of individuals and companies on... Read More

12 Tips To Great Websites

Why do some sites succeed while the vast majority of... Read More

Make Your Own Website - General Website Design Tips

Wow, we`ve already taken a domain and chosen a web... Read More

Why You Need a Website

You hear a great deal about the Internet these days... Read More

UK Online Shopping with an Edge, for Buyers and Sellers Alike

Any new website competing on the internet, needs to take... Read More

Getting One-way Inbound Links: the 5 Major Strategies

With search engines putting a damper on direct reciprocal links,... Read More

Linking Out is Good

Many websites I come across don't have a single link... Read More

Why Should Your Business Go O.N.L.I.N.E.

Optimize your time. How much time each day must you... Read More

Having a Portfolio on the Internet Can Help you Infiltate the Workforce

If you're an up and coming graphic/web designer just out... Read More

Building eCommerce Websites that Work - Part 2

Succeeding with an eCommerce website is a dream for many... Read More

User Interface Design: Key to Achieve Best Web Development

From early days of www, the Internet sites that are... Read More

Credibility - 10 Ways to Build it on Your Website

If you have your own business website and you are... Read More

Dreamweaver 8 Preview

August 8 2005, Macromedia announced a release of Studio 8.... Read More

Increase Hits to Help Increase Your Business

In this day and age most businesses consider having their... 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

Effective Webdesign

D.zigns dzignerwebs The Basics Before starting on... Read More

Web accessibility for screen magnifier users

The needs of screen magnifier users are overlooked when implementing... Read More

Freelance Programming is Easy to Manage

There are several reverse bid freelance sites out there. Beyond... Read More

5 Tips For A Better Website

Having an eye catching website is great, but are you... Read More

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

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

Easy Steps To Website Development and Promotion

One of the most important parts of establishing a new... Read More

4 Steps to Selling More With Your Web Site

Most web sites are more like stage sets than real... Read More

reliable home cleaners Arlington Heights ..