10 reasons the image format SVG is rocking the internet
By Matt Lipman ✦ January 30, 2018
Imagine sending email by typing in MS Word and sending the message over as a screenshot. Seems silly, right? But for many web designers, artists, and bloggers, that’s been our situation when designing vector graphics. You could compose scalable icons, but would need to export them as raster images for websites. Many logos were originally created in Illustrator, but then designers crop them and save them as .JPGs and .PNGs for web destinations. Resizing and/or changing a color became an entire process that started with going back to the source file, which is the MS Word document in my email analogy. You would make the desired changes, output the series of images, and re-upload all those files to your server.
Thankfully, that’s all changed. While scalable vector graphics (SVG) were introduced in 2001, only recently has the image format displayed consistently on the web, leading me to the first reason why the SVG format is kicking data and taking names.
Why SVGs are made of dreams
1) SVGs are widely supported
2) SVGs are speedy
SVGs are generally small in file size, and thus download faster than raster images. Also, inline SVG code can be placed in HTML directly and cut down on server requests. You need millions of pixels to fill a screen with a digital photograph on common-sized monitors, while you can make colorful full-screen SVG backgrounds with a fraction of the file size.
3) SVGs scale perfectly
They’re scalable – it’s in the name. With responsive design becoming the new norm over the last ten years, websites need to consider various screen sizes. Graphics that scale automatically are a welcome tool on the web for this very reason. Raster graphics —think JPGs, PNGs, and GIFs— on the other hand, cannot scale bigger without becoming blurry. And even though you can shrink photos on websites decently, your browser is downloading an image at the bigger than necessary file-size.
4) SVGs are high resolution
They look great at any resolution, and that’s important as higher-resolution devices become more popular. Your computer lacks the fictional CSI software that can zoom into images beyond their resolution without pixelation or getting blurry. Raster photos are composed of colored squares within a grid, unlike SVGs which are calculated through math to fit the current screen resolution.
5) SVGs can be styled through CSS
CSS is the way to style websites, and it is more powerful than ever. You can even style raster images, though effects target the entire image and may not be very practical. Like, how many websites really need to display an inverted image or change the hue? Blurs, opacity, sepia, grayscale, and brightness may have a place, though it is more common for designers to style elements around image, such as a colorful image overlay. SVGs on the other hand are written in XML and that means you can target bits and pieces that make up the entire SVG. You can change the color of an icon or re-position the direction of an arrow within an icon. You could hide and show reusable vector stars as part of a rating system. You can place many of these properties on mouse hovers for easy animations, which brings us to the next point…
6) SVGs can be animated
Raster images can look impressive, but unless you delve into video or gifs that come with large file sizes, animating digital photos is limited. Unlike raster images, SVGs are made up of smaller parts that can be manipulated. Picture a simple smiley face. In the SVG format, there would likely be a yellow circle for the head, perhaps two black circles for eyes, along with a curved line for a mouth. You could target any of those shapes to animate, and could make an eye wink by simply decreasing its height.
A more practical use is animating company logos. Many years ago, you were limited in hover effects. If a website visitor hovered over a logo, perhaps using a transparent .png logo, you could animate the background changing color. Now, with SVG, you can spin the logo mark, while changing letter color in delayed succession, and increasing the logo’s overall size.
7) SVGs can be rearranged easily
When preparing images for the web, the dimensions are often determined by the destination. Sometimes one website will want your image as a square – like Instagram – while others require portrait or landscape orientations. With raster images, you may have to crop images in ways that hide certain elements. However, with vector graphics, you can simply re-position and re-size elements around varying dimensions.
If you download free stock photographs and free vector graphics, you can make color edits to match your company branding. With vector graphics, you can do it with the click of a button, but with raster images, you have to work to recolor section by section.
8) SVGs support transparency
Not all raster formats allow transparency, and those that do come with some drawbacks liked jagged edges with .GIF or hefty file-size with PNG. Transparency works well with SVGs, and is one of the main reasons I use SVGs for company logos on websites. It allows simple hover effects for the background of the logo. Transparency is a great way to break away from rectangular graphics and blocky websites. It is easy to see, transparency is great.
9) SVGs are great for readability
How common are hero images? Hero images are those full-screen images (or videos) that welcome visitors on websites, especially on homepages. Often, text appears over the visual, and even though it’s usually large and bold, sometimes readability is sacrificed in the name of hip visuals. SVGs integrate into websites in a way that doesn’t force designers to place text over them. Photographs come with boundaries, whereas you can simply pull specific elements of imagery onto the webpage in a way that you can’t with photographs.
Regardless, for a fair comparison, let’s assume the imagery takes up the whole screen whether as a raster or vector graphic. In either case, there are certain visual choices that can help or hurt readability. You obviously shouldn’t put white text over very light imagery. You also shouldn’t place thin or intricate fonts over imagery that has varying jumps of high contrast, such as text over a bare tree. This last point is where SVG shines. Photography comes with fine details, noise, and uneven contrasts that are not ideal to overlay with text. SVGs, however, often use flat design and solid colors, which are more suitable behind text. With responsive design, text over images doesn’t always line-up consistently from device to device, so it is important that background visuals contain less noise.
10) SVGs stand out
In a world where seemingly everyone carries around a device that hosts TWO camera lenses, photographic imagery is widely used on amateur and professional websites alike. Everyone has access to free professional-grade photographs at their finger tips. There’s also Google images for those with no moral compass or fear of lawsuit. Photographs are more commonly used on websites than vector graphics, so if you’re after a more unique look, you can give your customers a visually memorable experience with custom SVGs tailored to your business.
There are reasons most logos are designed with vector editing software like Adobe Illustrator. Great logos distill a complex concept into an easily understandable visual mark. Vector graphics can send a visual message with precision – cutting the background noise and blurry interpretation that often comes with photography.
SVGs are scaleable, small in file-size, high definition, well-supported, and great for readability. They can also be customized, styled through CSS, animated, transparent, translucent or opaque, and the perfect way to standout from competition. SVGs are awesome, but not perfect. Unlike Franks Red Hot Sauce, you might not what to put that on everything. SVGs aren’t suitable in every situation. Because they’re not 100% compatible in email yet and they often have a highly illustrative style, SVGs may not be right for every brand’s website. That said, this visual format is an underutilized powerhouse that is finding its place across the internet. SVGs have won my heart. They will soon win your heart too.
CSS stands for Cascading Style Sheets. It is code that controls the visual styling of HTML elements from the colors of text, to the sizes or positioning of images. In its latest version, CSS3, animation can be accomplished.
CSS is often used as a stand-alone file using a ‘.css’ file extension, but it can be included with HTML code for smaller projects. Designers and developers typically keep the styling rules separate using a stand-alone CSS files because doing so keeps everything organized and makes it easier to build upon.
CSS is text based, so one rule designers follow is not to use images, if the same can be done using CSS. This is simply because images are large in file size and will make a website take longer to load, which is especially bad for mobile visitors who may be on slow connections.
The greatest feature of CSS is that its code is reusable. In other words, you can style a box to be yellow with large black text and rounded corners, then apply that styling to as many HTML elements as you want. All you would need to do is reference the styling in the HTML element to inherit given styles.
What can you do with CSS?
CSS is powerful. You can specify how HTML elements look and behave in various situations. With text, you can select its color, size, font, alignment, and more. With CCS3, you can now even give text shadows, or slowly change colors with cursor interaction. You can now specify different styles based on screen width, which is the foundation of responsive design.
The above CSS code tells the browser “If the screen width is at least 500 pixels big, apply these styles.”
Here are common uses of CSS:
Displaying background visuals, from solid colors or gradients to full-screen or tiled images
Positioning content into columns of various fixed or fluid sizes
Hiding elements is also a way to style HTML
Aligning navigation to the top, sides, or even hidden until a button press reveals a drop down menu
Animating elements from a simple button hover state to a repeating sequence of 3D transformations
How does CSS work?
Browsers render HTML, which means that the HTML code is realized visually. CSS gives instruction on how HTML elements should look. Without CSS, the browser would still render the HTML code with default stylings, which differs from browser to browser.
CSS works by connecting HTML elements, such as text or images, with CSS refernces. The references are id‘s, classes, and HTML element names.
<img id="logo" class="graphic" src="/logo.jpg">
In the example above, you have an image HTML element (<img>) that has ‘logo’ as the id and ‘graphic’ as the class. There are four ways to change the visual styling of this element with CSS. The following examples are different ways in which you could set the width of the image to be 200px.
The first ways references the HTML element name: “img”, which represents images. This will instruct not only this image, but all images that appear in the HTML code. In this case you would be telling the browser to set all images to have a width of 200px.
The above example showcases an id, which should be only given to unique HTML elements. The pound sign ‘#’ (aka the number symbol or hashtag if social media is your thing) tells us that we are working with an id. If you need to have multiple instance of this element, you should use a class instead, which brings us to our next example.
In the example above, “.graphic” is a reference to a class, as a period precedes the name of the class. Classes are reusable styles that can be applied to different HTML elements. In this case, the image will have a width of 200px. You could give other HTML elements, like an input box, the same class to set the same dimensions. The first three methods, demonstrated so far, allow coders to style HTML elements from a stand-alone ‘.css’ file. The last method is different.
<img style="width:200px;" src="/logo.jpg">
Inline CSS, used above, is a way to style an element from the HTML element directly. Inline CSS is hard to manage and should be avoided in many cases, but can come in handy for a few situations.
CSS is the visual heart of web design
You have a website for a reason. You want visitors to get the information they need, often with the ultimate goal of converting into sales or making some other important actions.
Would you expect a visitor to call your business if you didn’t list your phone number? That’s what it’s like to a user who cannot access your website as intended. Even if the right information is present on your website, users can be discouraged from searching if there are obstacles in the way. Sometimes, from a visitors standpoint, it is easier to look elsewhere for similar or competing information.
You may have contemplated why you need a mobile website, here are the top ten reasons to ensure your website is mobile friendly:
10. Desktop features can fail on mobile
9. The user experience is very important
Even if all your website content works correctly on both desktop and mobile, your visitors experience will suffer if your website is not tailored to mobile devices. You are requiring them to zoom, read tiny text, scroll sporadically, and use an interface that might require pin-point precision or multiple attempts to click a desired button.
8. Load times are different
Mobile devices often connect to the internet on the go. They don’t always have the convenience of a home network that gets fast internet. Expecting your website to load quickly on a bad network connections is naive. Mobile design optimizes load time by shrinking file sizes, cutting unnecessary content and removing certain design elements or graphics.
7. Adults stay near their smartphone
91% of American adults keep their smartphone within arm’s reach. Smartphones are changing the way people interact with the world, and more and more people are gaining access to smartphones. Your business cannot simply ignore the fact that smartphones are highly integrated into people’s lives. (source: Morgan Stanley)
6. Mobile searches lead to action
9 of 10 mobile searches lead to action. More than half lead to sales. Mobile users are efficient with their time and ready to make a decision. When they are searching to find a restaurant, they are going to eat somewhere. When they are looking up a phone number, they already decided to call. They also buy products or tickets, look-up hours of operation, message businesses, and share or bookmark web content. (source)
5. Mobile users have specific goals
Mobile phones are called mobile for a reason, their users are usually on the go and often have one simple task. They might want your phone number, address, or hours. Catering your mobile site to address the most common on-the-go tasks can go a long way in satisfying the majority of those visits.
4. Mobile users have different expectations
Your desktop version might expect people to type paragraphs, or copy and paste text or other tasks which are overly complex or difficult on a mobile device. A mobile website can prepare for these situations by making a phone number clickable and so on.
3. Mobile devices are here to stay
Mobile devices are literally taking over the world. According to Pew Research Center, in October of 2014, “64% of American adults now own a smartphone of some kind, up from 35% in the spring of 2011.” (source)
2. Mobile helps you stay competitive
If your competition has a mobile site and you don’t, you’re at a horrible disadvantage. If you have a mobile website, and some of your competition does not, you gain an edge and will likely gain some extra business.
1. Get more traffic though search engines
Google is favoring mobile-friendly websites on searches done on mobile devices. In Google’s own words (2/26/15): “Starting April 21, we will be expanding our use of mobile-friendliness as a ranking signal. This change … will have a significant impact in our search results. Consequently, users will find it easier to get relevant, high quality search results that are optimized for their devices.” (source)
What to do after deciding to be mobile-friendly
The decision is the first step, how to go about the conversion is the next step.
The two main routes to make a mobile-enabled website is through responsive design or a stand-alone mobile site. Bump Set Creative caters to small businesses who generally don’t have the time or resources to manage both a desktop and mobile website. Responsive websites take the same content, and change the layout to fit varying screen widths, making it ideal for a business to change all the content in one centralized place.