SpyreStudios

Web Design and Development Magazine

  • Design
  • Showcase
  • Inspirational
  • Tutorials
  • CSS
  • Resources
  • Tools
  • UX
  • More
    • Mobile
    • Usability
    • HTML5
    • Business
    • Freebies
    • Giveaway
    • About SpyreStudios
    • Advertise On SpyreStudios
    • Get In Touch With Us

Choosing the Best Image Format in 2021: WebP, SVG Vs. Everyone

November 24, 2020 by Alex Fox

What, did you think JPEG would live forever? It was introduced in 1992, more than twenty-five years ago! The modern generation of web developers uses WebP for images, not the archeological specimen that is JPEG. Here’s a quick introduction to WebP, SVG, and why they’re better. TL;DR: they’re way smaller and produces faster and more responsive websites.

What is WebP?

 

The WebP standard is something of a meta image format, including several modes under one heading. It’s both a file extension (.webp) as well as a compression algorithm. To use the language of video encoders, WebP is both a container format and a codec.

Because the compression algorithm can save images both lossily and losslessly, describing an image as a “WebP” doesn’t really make as much sense as calling an image a “jpeg”. It’s like saying it’s a file: that can mean so many things that the word isn’t vastly useful, except in the most general of terms. To illustrate, here are some of WebP’s feature highlights.

  • Lossless compression
  • Lossy compression, similar to JPEG
  • Lossless transparency/alpha layers
  • Compressed transparency/alpha layers
  • Animated images, similar to WebM

It’s also related to the WebM standard, which is used for moving images.

In fact, the WebP compression algorithm uses the intra-frame encoding algorithm of the VP8 video compression algorithm. As with VP8, it is a block-based transformation scheme with eight bits of color depth and a YUV 1:2 chroma subsampling ratio (YCbCr 4:2:0), which is the same as the default chroma subsampling ratio on MPEG2 and MP4.

WebP also provides one of the more trendy features of modern encoding algorithms: predictive encoding. Using complex mathematical formulas, the encoding algorithm will try to “predict” the value of the next block. Good prediction can remove redundant or unnecessary data. Most importantly, it works especially well on the most common types of images. That makes it a valuable tool in compression, where it can save considerable space over non-predictive algorithms.

You can learn more about WebP or check out Google’s technical documentation.

What is SVG?

Yug, modifications by 3247 [CC BY-SA 2.5], via Wikimedia Commons

An SVG is a vector graphics file. Rather than saving the pixel values as an image would, a vector saves the mathematical relationship between the points defining a shape or design. In that way, the design can be infinitely scaled and endlessly edited, all without loss of data. Whereas images tend to degrade each time they are processed, an SVG will always be flawless. This is because compression algorithms often save space by using a type of destructive rounding called lossy encoding. Because SVG stores the exact mathematical values of the point relationships, there is no data to round off and destroy.

An SVG image is actually completely defined via text in an XML document. All the features of SVG are triggered by XML tags, meaning that any text editor can also be a fully-featured SVG image editor. For an inside look at this XML code, check out the SVG source for the standard’s logo. 

This also means that SVGs take up very little space. The text descriptions of SVG files take up far less space than a JPG or PNG showing an equivalent image. The downside is that SVG completely falls down when trying to save a photograph. The standard is designed to process and save mathematically-calculated point relationships in somewhat regular two-dimensional polygons, which are famously absent in photographs. That’s exactly what WebP is good at, making SVG a natural companion to the jack-of-all-trades image format.

On the other hand, if you’re to compare SVG and WebP, you could say that SVG is still much more popular. According to the survey done by W3Techs.com, statistics show that 28.5% of all the websites use SVG while only 0.4% uses WebP. That is quite a considerable difference, don’t you think?

For geometric designs and illustrations—logos, especially—SVG is the perfect format. They scale infinitely, just like vector images. One SVG of your company’s logo can be losslessly scaled to any size necessary and displayed anywhere on the website, at any pixel scale or display density. And because all web browsers are also native SVG pre-processors, your image will show up flawless in every web browser.

SVG gets some flack for being a bit of a Hunchback of Notre Dame: it’s ugly and misunderstood by the masses, but pure of heart and earnest if you give it the time of day. Don’t let that prejudice stop you!

Everyone Else

In our war of image formats, WebP and SVG make up one army. Every other image format is on the other side. Because with SVG and WebP, you can save and display just about all graphical content you can imagine. There both well-supported by browsers, space-efficient, and fully-featured enough that you won’t regret implementing them.

That said, there are some perks of being on the “everyone else” team. First, JPG is the single most widely spread file format. More than PDF, more than DOC, more than any other file format, JPG is essentially the lingua Franca of the file processing world: everyone speaks it. So, naturally, WebP isn’t as widely supported as JPG– yet.

It’s becoming more popular as Google pushes it harder, and is already supported by something like 80-percent of web browsers. Mobile is the big hold out: Apple doesn’t include support for WebP/WebM in either version of Safari, preferring to push their preferred HEIC/H.265 standards instead. As in any standards war, it’s the consumer who loses while the companies duke it out.

So What?

Why are we so hot under the collar about WebP and SVG? What makes these formats so much better than their competitors?

BETTER ALGORITHMS MAKE SMALLER FILES

Everything you put on your website costs the user time and money. They pay, with their time and their money, to download your content. With good content, the value typically exceeds the annoyance of having to download the file. With bad content, the relationship is exactly inverted.

As internet speeds have improved, the cost of including new doohickeys on your website has been lowered to the verge of insignificance, at least when you’re on a broadband connection. But mobile users the world over still live in The Land That Broadband Forgot, with spotty and slow connections more typical than wireless carriers like to admit. Smaller files of equivalent size are still better: the advent of broadband didn’t wipe out the rules of entropy but instead made them less abysmally restrictive.

The only current downside of WebP is its slightly spotty support by browsers. For the time being, the best option is to include JPEG polyfills for unsupported browsers. As with any new technology, it pays to start using it now and learn the ropes before it explodes in popularity. Your users won’t know much of a difference in the quality of your images but your website will be magically faster, and everyone loves that!

You might also like the following posts:

The Developer’s Guide to the WebP Image Format

31 Fresh Design Elements for Spring and Easter

4 Examples of Bad UI and How to Avoid Them

Filed Under: Design, Photoshop Tagged With: image formats, images, web design

Recent Posts

  • 31 Fresh Design Elements for Spring and Easter
  • 10 Templates for Music Concert Flyers
  • How to Build a Web Scraper Using Node.js
  • Best PHP Books, Courses and Tutorials in 2022
  • How to Get Your First Web Design Client

Archives

  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • May 2008
  • April 2008

Categories

  • Accessibility
  • Android
  • Apps
  • Art
  • Article
  • Blogging
  • Books
  • Bootstrap
  • Business
  • CSS
  • Design
  • Development
  • Ecommerce
  • Fireworks
  • Flash
  • Freebies
  • Freelance
  • General
  • Giveaway
  • Graphic Design
  • HTML5
  • Icons
  • Illustrator
  • InDesign
  • Infographics
  • Inspirational
  • Interview
  • Jobs
  • jQuery
  • Learning
  • Logos
  • Matrix
  • Minimalism
  • Mobile
  • Motion Graphics
  • Music
  • News
  • Photoshop
  • PHP
  • Promoted
  • Rails
  • Resources
  • Showcase
  • Tools
  • Tutorial
  • Twitter
  • Typography
  • Uncategorized
  • Usability
  • UX
  • Wallpapers
  • Wireframing
  • WordPress
  • Work

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

SpyreStudios © 2022