The Internet was abuzz last week after the announcement of Google’s new logo. What caught our eyes more than the artistic changes was this sentence on Google’s blog: “building a special variant of our full-color logo that is only 305 bytes, compared to our existing logo at ~14,000 bytes”. Sounds exciting! But is it correct?
As Google owns the most popular site in the world, the size of their logo, which appears on most of their pages, is critical. Even a small reduction in file size means huge bandwidth saving (and therefore money saving and global energy saving). A drastic change of X46 from approximately 13.7KB to only 305 bytes sounds amazing, so we decided to see what all the fuss was about.
The bottom line is that these promising numbers can be misleading. As explained below the actual logo images embedded in Google’s web pages are much bigger and can be optimized dramatically.
How can Google’s new logo fit in only 305 bytes? Well only as a SVG file and definitely not as a PNG file. As Gizmodo explained in their article (originally on Quora), the new logo can be defined using a few circles and rectangles. For more details see: http://gizmodo.com/how-could-googles-new-logo-be-only-305-bytes-while-its-1728793790
Google’s article announcing the logo change mentioned that the logo’s file size was reduced from ~14,000 bytes, but it seems that there may have been a PNG and SVG mix here.
The old logo in a vector format (SVG) weighed only 2.4KB. See:
2.4KB still equates to the old logo being X8 bigger than the new logo, but this difference is quite different from the claimed X46 reduction…
Even if the file size reduction is ‘just’ X8, this is still very impressive. We decided to check it out. We went to Google’s most visited web page, http://google.com, as seen in the screenshot below.
Apparently Google is displaying the logo on their homepage as a PNG file of 544×184 (272×92 with double pixel density ratio). This image file weighs 13.3K, which is much larger than the promised 305 bytes logo…
I’m using Google’s Chrome web browser which supports the SVG format. Why would Google choose to deliver this image as a PNG file, which is actually X45 bigger than the promised size and wastes 97% of the bandwidth involved in delivering the logo?
By the way, the old logo converted from SVG to a 544 pixels wide PNG weighing 22.2KB, which is just X1.7 bigger than the new logo.
Maybe Google decided not to use the SVG format because older browsers don’t support it. But there might be better solutions for that as well, as explained below.
Google delivers the new logo using the PNG-24 format and it weighs 13.3KB. But why not use the 8-bit version of the PNG format that definitely has a wide enough color space for such a logo?
The following on-the-fly image manipulation URL creates and delivers a PNG-8 version of the logo.
The resulting image looks exactly the same as the original image and is just 9.1KB! We’ve just saved Google about 32% of the bandwidth involved in delivering the logo on their homepage.
Google is promoting their modern WebP image format, which is supported by the Google Chrome browser. The following dynamic URL delivers the logo as WebP for Chrome browsers and as PNG for other browsers. The image as a lossless WebP looks exactly the same and weighs just 11.2KB. Which means a saving of 16% compared to the original PNG image.
If Google insists on delivering rasterized images rather than embedding SVG files, the file size can be further reduced.
As you might have noticed, Google embeds a double resolution (’retina display’) version of the logo (544×184 instead of 272×92). The X2 image is delivered to devices and browsers with regular resolution (i.e., DPR 1.0), which do not benefit from the high resolution image. Checking the actual device resolution and delivering a regular 272×92 image when relevant, would make the file just 8KB, which means 40% bandwidth savings.
And if Google really wants their logo to be delivered quickly to places and devices with slow Internet connection, using a 70% quality lossy WebP image with a white background (rather than transparent), would result in a 4.7KB file (65% bandwidth savings).
Whether Google’s new logo is better than the older one is a matter of taste, but aiming for a file that consumes less bytes, reduce costs and improves performance is definitely a very smart choice. Highlighting the huge improvement in file size as a part of the logo announcement was an interesting twist and definitely helped Google’s PR efforts.
Google might consider switching to SVG for displaying the logo on their sites. Until then, the delivered PNG images are much bigger than the promised 305 bytes. As shown in this post, even when using rasterized images, the file size and consumed bandwidth can be reduced dramatically using the PNG-8 format, the WebP format and regular DPR 1.0 image dimensions or lossy WebP compression.
All image format conversion and image transformations mentioned in this post were done on-the-fly with Cloudinary’s cloud-based image transformations and image optimizations.