Different Types of Image Files Explained

This is the most common technical question we get: “What format should I save my image in?” There are many different types of image files and most people do not understand the differences. In this article, I’m going to tell you what you need to know in order to choose the right format for your purpose.

There are two ways to interpret visual information digitally. One way is to record the step-by-step instructions, like a cooking recipe. For instance, your computer writes down: “Use a blue pen with a thickness of 3 pixels. Start drawing a straight line at the location X=120 and Y=324, and end at X=450 and Y=1300.” Or, “Draw a red circle that is 300 pixels wide at the location X=324 and Y=654.” Given the instructions, another computer would be able recreate it later on its monitor. This method of recording visual information is called “vector”. But unfortunately, vector file formats are limited in what kind of information you can record. It would have to be relatively simple and flat. A picture of your face, for instance, is too complex to record in this manner.

The other method is called “raster” which breaks up what the camera sees into a whole bunch of dots (pixels), and records the color of each. Like reading a book, you start reading the pixels from the top left and end at the bottom right. This is exactly what your scanner does. The light emitting censor travels across your photo or document, breaks up what it sees into a bunch of pixels, and records each color value. The only difference between a scanner and a digital camera is that the latter does it instantaneously.

Raster file formats can record any kind of images. You might then ask: “If raster file formats can record anything, why don’t we just use raster format for everything? Why do we need vector file formats?” One answer is that vector files are usually much smaller. Breaking up the world into a bunch of tiny pixels and recording their values results in a lot of data to store. If this were the only advantage of vector file formats, they would become obsolete once everyone has a super-fast Internet connection and a massive hard drive, but there is another advantage: It can be enlarged infinitely. Because they are recorded as instructions, it’s easy to reinterpret them at a different scale. For instance, if we interpreted the numbers used to record the locations and sizes to mean feet instead of inches, it would instantly become larger without losing any quality. If you enlarge raster images, you begin to see the pixels. For this reason, you would want the logo of your business in a vector format. You might use your logo for a large flag or a huge outdoor ad. If your logo is saved in a vector format, you could enlarge it 100 feet tall and it would still be perfectly sharp.

The most common raster file format is JPEG. In most cases, you would see “.jpg” or “.jpeg” at the end of the file name, like “my-cat.jpg” or “mydog.jpeg”. (If you are naming the file yourself, it’s better to use “.jpg”.) A JPEG file can be opened in just about any programs. You could open it with a web browser, image processing programs like Microsoft Paint, Adobe Photoshop, or even word processors like Microsoft Word. “JPEG” stands for “Joint Photographic Experts Group”. The only important thing here is the word “Photographic”; it was designed for photographic images, not for a flat graphic image like a logo.

The most common vector file format is EPS, but it gets a bit confusing because you can embed raster images into vector file formats, which means you could get an EPS file that contains nothing but a raster image. The same is true for other vector file formats like AI (Adobe Illustrator) and PDF (Adobe Acrobat). I’ve often received raster logos from clients, and when I asked for “vector” logos, some of them simply copied and pasted the raster logos into Adobe Illustrator and saved them as an AI or EPS file. If you understand the fundamental difference between raster and vector, you would understand that this would not magically convert the pixels into mathematical instructions. If you do not have a vector version of your logo, it means that you would have to create it from scratch. There is no easy way to automatically convert a raster image into a vector image, although it’s easy to go the other way. It’s like trying to write a recipe for a dish you are served at a restaurant.

Another common question that people come across is what “size” means for digital photos. There are two possible ways to interpret what is meant by “size”. One is the dimensions of the photo. It may contain 2,000 pixels across and 1,000 pixels down. Or, it may contain 10,000 pixels across and 5,000 pixels down. The latter is obviously larger in “size”. Another way to interpret “size” is file size. Intuitively you might assume that the larger the dimensions, the larger the file size. This is not so because JPEG has a way to “compress” visual data. If the same amount of compression were applied to both examples above, the latter with the larger dimensions would be larger in file size, but it’s also possible for both to have the same file size if you were to apply more compression on the latter. To avoid this confusion, when speaking of “size” in digital photos, be specific whether you mean “file size” or “dimensions”.When you “compress” a digital photo, the dimensions of it would remain the same, but you lose the quality (or the definition) of the image. The image above shows the loss of quality as you compress more (it’s more compressed on the right side). If you are printing the photo, you would want the file that is least compressed, but if you are just showing it to someone as an email attachment, you might want to compress it so that the file size would be manageable. In general, you wouldn’t want your email attachment to be larger than 1MB.

There are many other raster file formats, like TIFF, BMP, PICT, PNG, PSD, and GIF. The only reason why you might want to consider using any of these formats is to save your image without compressing at all. JPEG by default compresses your image even at its highest quality setting. If you do not want to compress your image and retain its original quality, use either TIFF or PNG. These formats allow you to save it uncompressed. The other file formats are less common and achieve the same goal, so you might as well use more common formats. If you have a raster image that is flat, like a logo, use PNG and compress it. PNG can compress an image without losing any quality, but it only works if the artwork is flat and have many pixels with identical colors (It basically skips the pixels with the same color and marks them as “the same as before”). Next time you need to send an image file to someone, hopefully now you know what you have to do.