In this blog post, we’re breaking down the most common image types that you might come across during both your design phase when creating or editing original files, as well as the image formats used to display on the web.
We’ve also included a handy cheat sheet infographic at the end of this post.
- A raster image is comprised of a series of pixels, each which contains its own RGBA color make-up. Raster images are generally used in conjunction with photographs or image types with a high level of detail. Upon magnifying a raster image, the individual pixels will become exposed, creating a blurry or jagged appearance, particularly around the edges.
- A vector image is comprised of a series shapes or elements created with points, paths and curves that follow mathematical principles. Most commonly, vector images are created through Adobe Illustrator. Vectors can be scaled, and even at levels of extreme magnification, will retain visual clarity and crispness.
- A lossy compression is a form of data compression that sees the loss of pixel data.
- A lossless compression is a form of data compression where no data is lost, only compressed.
For more in-depth explanations of the concepts above, read through the previous blog post: Everything You Need to Know About Image Formats and File Types (Part 1).
IMAGE TYPES USED IN GRAPHIC DESIGN
There are a number of other file formats that are used during the creation, design or edit phase. The most common of these file formats are described below.
TIFF
EPS
RAW
IMAGE TYPES USED IN WEB DEVELOPMENT
SVGs are pretty much in a class of their own as the file format is the only one that can display vector based images on the web. The other file formats – JPEG, GIF and PNG – have quite stark differences between them.
JPEG
Designed for the exact purpose of removing slight graphic detail from an image that the human eye wouldn’t really notice, the JPEG generally makes use of lossy compression, meaning that the image will lose data and thus quality as it is compressed. As the JPEG form is good at handling a number of colors (supporting over 16 million colors), it’s great for photographic imagery, but as lossy compression process will eliminate a number of pixels, the JPEG form is not exactly the best format for logo graphics or other core branded assets.
The real strength of the JPEG file format is that the level of lossy compression can be adjusted, giving the user the highest level of control in determining final image file properties, as opposed to other file formats.
Probably the easiest way to understand the quality vs file size trade-off when using the lossy format is the JPEG image compressor’s quality slider, as provided during Save in the Adobe Suite applications. Here, the user is able to see the adjustments in image quality and note the changes in file size. For example, the lower the quality, the greater the compression, the smaller the file size, and vice versa. Remember, portions of data are lost each time the JPEG file is saved, so repeat compressions will result in irreversible loss of image data and quality.
JPEGs in a nutshell:
- Safe to use on all web browsers
- Can’t support animation
- Use for web display images or photographs
- Do not use for logos or branded assets
- When optimizing for the web, test out a combination of quality settings for determining the best trade-off between picture quality and file size
GIF
Making use of lossless compression, if your original image contains a higher color value than suitable for GIF properties, the image data will automatically be recoded and reduced to fit the GIFs maximum of 256 color requirement. Despite this, images that fall within the set color constraints, a GIF will never lose data or quality during repeat saves.
GIFs are best used for graphic assets that don’t require high levels of image quality but do require a rapid load speed. If your website needs to include an image that is not as detailed as a photograph, a GIF might be a good file format option for you, and would be suitable for simple diagrams, possibly infographics, logos, or similar. Another popular use for the GIF file format lies in its animation ability (supported by all browsers). Here, designers can interlace a series of images to form a looping animation. In this regard, GIF assets are great to include with content marketing or blog pieces, particularly as powerful visuals that communicate a series of messages, instructions or similar.
Finally, GIFs are also optimized to include transparency on the RGBA Alpha channel, although PNGs export with slightly better quality in this regard
GIFs in a nutshell:
- Safe to use on all web browsers
- Can support animation
- Do not use for photographs
- Can be used for logos or branded assets
- Used for short animations
PNG
Saving images as PNGs present two options: PNG-8 and PNG-24. In a sense, not strictly speaking, the PNG file formats can be somewhat compared to the GIF and the JPEG respectively.
A PNG-8 file can only support a maximum color palette of 256 colors – just like a GIF. PNG-8 formats can be used for graphics with areas of either few colors or small variations in color, such as logos, icons or any graphic that do not include extensive detailing. The difference between GIFs and PNG-8s is that PNG-8s cannot support animation but will have better transparency results on the RGBA Alpha channel.
A PNG-24 file supports a wide range of colors (over 16 million) and can be used for photographic images. Saving a file in a PNG-24 format will make use of lossless compression, seeing it as a good alternative to a JPEG as no data will be lost. This, however, could result in a larger final file size so be sure to test both JPEG and PNG-24 formats when bargaining with file size and quality.
PNGs in a nutshell:
- Safe to use on all web browsers
- Cannot support animation
- Great for images with transparent backgrounds
- Use PNG-8 for logos, branded assets or graphics with very few colors
- Use PNG-24 for photographs but stay conscious of the final file size (if too large, test a JPEG format)
SVG
SVGs are XML images. Most commonly, SVGs are created by designing an item in Adobe Illustrator and exported as an SVG file type. Alternately, they can be scripted into direct XML markup language by a text editor. The great thing about SVGs being in XML form, is that each of the image’s elements are rendered as objects and can be easily edited through the use of JavaScript.
As the SVG’s properties are essentially coded, each individual vector shape within the full image can easily be edited using code. Say, for example, your logo was comprised of a graphic of a house, where the roof element of the logo was brown. By using code, you could simply assign different color properties to the parameter to change the color of the roof as opposed to saving and exporting a series of individual files that ultimately would take up server space.
There are two things to keep in mind with SVGs:
- Complexity of design, and
- Metadata
If for example, your vector design is extremely complex and makes use of a number of elements, this might have an effect on the final size of the exported file. As the mathematical calculations of a vector image require more legwork in computing than raster images, a complicated and heavily layered SVG might end up creating a large file, ultimately having a larger effect on file size. With this, it’s advised to simplify and refine your design to its core elements to ensure that the final combination of shapes has the lowest level of complexity. So, be really clever with your design from the start when working with the elements on the artboard.
Secondly, as SVGs make use of XML markup language, they will contain a series of scripted properties, including metadata. These properties are superfluous and don’t have any effect on the display of your image, instead, they’ll push up the file size. So, if possibly be sure to strip away this metadata from your SVG file.
USING SVG FILES WITH WORDPRESS
To begin using SVG and SVGZ (compressed SVG) files on your WordPress website, you’ll need to give the media library permission to accept unrecognized file types. There are two easy methods for this:
- Install a plugin such as SVG Support
- Add the following lines of code to the functions.php file in your child theme
function add_svg_to_upload_mimes( $upload_mimes ) { $upload_mimes['svg'] = 'image/svg+xml'; $upload_mimes['svgz'] = 'image/svg+xml'; return $upload_mimes; } add_filter( 'upload_mimes', 'add_svg_to_upload_mimes', 10, 1 );
Note: If you require further information regarding child themes, read our blog post which explains why using a child theme is vital for your WordPress development practice and also offers instruction regarding how to create one.
SVGs in a nutshell:
- Safe to use on all web browsers
- Can support image changes with JavaScript
- Displays well on high resolution and retina display screens
- Great for logos, icons
- Small file size (if designed for low complexity and stripped of metadata)
- Use a plugin or add code to the functions.php file in the child theme to enable SVG and SVGZ usage within WordPress
Image File Types and Formats Cheat Sheet
If you have any comments or queries, please feel free to share them below. We love hearing your feedback!
Thanks for reading!
I think one file type is missing: WebP
Although not supported by all browsers (yet?)
https://developers.google.com/speed/webp/
https://en.wikipedia.org/wiki/WebP