BLOG

Raster vs Vector

What are raster and vector graphics, and how do they differ from one another? Read our deep-dive on the topic.

What is the best format for your prints?

What are raster and vector graphics, and how do they differ from one another? These are questions that stakeholders often pose when encountering image-related technical challenges that don’t fall within their usual spheres of knowledge. The answers are, well, technical, but of interest to many in the world of textile printing. This blog post functions as a guide to help and illuminate those among our stakeholders who would like to learn more about image file types and about how using them correctly can lead to better products. We hope it will be of help.

The source image
The source image, i.e. the image of the customer’s logo that the printer needs to create the accompanying proof, is an important element for any textile printer. Not on account of its contours and colour composition, but because of its file type. The question we have to ask ourselves and our customers every time a new image lands in our inbox is: Is it raster or vector?

Why is that? Because while raster files are usable as source image for textile prints, they are saddled with so many disadvantages that vector files are to be preferred in almost all cases. The fundamental reason why by far the most printers — ID UNLIMITED among them — recommend that their customers submit images in vector format is the simple one that they yield better results. Why? Let’s find out by examining the two formats’ advantages and disadvantages.

Raster
A raster image is modelled by a two-dimensional Cartesian coordinate system in which so-called ‘pixels’ are placed, together making up the image. Each individual pixel is equipped with a colour and a unique set of coordinates that precisely specifies its place on the grid. From there the pixel’s colour engages in a kaleidoscopic collaboration with the surrounding colours, together comprising the complete image.

Any individual pixel is but a simple, square colour fragment. But place a multitude of these otherwise charmless squares into sufficiently fine-meshed patterns, and almost boundlessly beautiful, vivid and elaborate mosaics can emerge. In the RGB colour model – the colour model raster files typically use – any given pixel can be equipped with one of no fewer than 16,777,216 different colours. Photorealistic images are always raster graphics, as co-acting pixels can produce compositions and colour gradients no other image formats or colour models can match. Another advantage with raster is that images are editable at a much more atomic level with software like Photoshop. It’s unusually tedious and time-consuming – and consequently almost never done – but with enough skill and patience a graphic designer can in principle edit a raster image all the way down at the level of the individual pixel.

The number of pixels a raster image consists of determines its quality. This property is known as ‘image resolution’ and is the deciding factor in how an image is interpreted by the retina. The more pixels, the clearer it appears (up to the eye’s biological limit, which – dependent on context – is about 300 PPI at a distance of about half a metre). The density of the pixels is expressed as PPI or ‘pixels per inch’. Let’s illuminate further with a concrete example:

If we want to print an image with a PPI of 240 – which is the lowest pixel density suitable for textile printing – onto a textile area with a width of 6 inches, we multiply the values and get: 240×6=1440. Thus, the raster image must have a width of 1440 pixels to be usable across the desired area. We can also move the variables around and determine the maximum size in which the raster image can be printed: If we have an image with a width of 1440 pixels and know the pixel density must not fall below 240, we divide the numbers and get: 1440/240=6. Hence, the raster image can be printed with a width of 6 inches before losing quality.

So far, so good. But the raster format’s weakness – and the knock-down argument against its employment for printing purposes – is its fixed pixel count. Once a raster image has been created comprising a certain number of pixels, that fundamental composition is immutable. So if we find ourselves wanting to manufacture a logo with a width of e.g. 8 inches – and want to keep its resolution – we require a larger pixel count than the image has.

Let’s again get out the calculator: 240×8=1920. We require 1920 pixels in width for the new, larger image but have only 1440. So if we print the logo, it will emerge with a pixel count that fits an area 25% smaller than prescribed by the resolution. Each pixel is now stretched to cover a larger area and consequently appears duller and blurrier than before. Since logos often must come in varying sizes – the size of a logo on the back typically differs from that on the chest – a graphic designer needs to work with images that allow for easy handling and augmentation. This remains especially true if the logo contains a font that – as you can imagine – pays a disproportionate price for loss of quality. It doesn’t take many grainy pixels before a text ceases to be legible. For this reason all fonts on the internet – where users will often zoom in and out on a text they’re reading – use the vector format.

Vector versus raster: the same red letter M enlarged — sharp as a vector, pixelated as a raster

‍
A related factor that similarly works against the raster is the file size. An image’s pixel count is directly reflected in its size. Independently of PPI, which – as you recall – is an expression of pixels per inch, the file size scales proportionately with the total pixel count. Two images with identical PPI but different dimensions will have different file sizes. Since the image editing software must be capable of handling data pertaining to an image’s every pixel, the file size will greatly influence the speed with which the program can process the image. The more pixels, the better the image quality. The better the image quality, the larger the file. The larger the file, the slower the processing and the quicker the hard drive fills up.

Vector
The vector file is based on mathematical formulas that calculate and draw precise geometric elements in a coordinate system. They are drawn through calculations of exact point values and their connection with lines and curves that together comprise the full graphical expression. Such geometric building blocks – lines, circles, polygons, curves etc. – make the vector file well-suited for use within structure-based line graphics, which typically deals with 2D images with clean features and homogeneous, flat colours. The same building blocks simultaneously make the vector file unsuited for the realistic renderings often seen in digital photographs, as flat colours lack precisely the colour depth crucial to image realism. An important characteristic of the vector file is that it – unlike the raster file – isn’t required to manage millions of pixels but only has to remember a few coordinate points and the line equations that connect them. Because of this the vector file takes up significantly less space and is easier to transfer, move around and work with.

Let’s again illuminate with an example: If we want a circle to be rendered by a raster image, the image will have to manage several million binary digits (bits) and deal with the accompanying file size. A vector file, on the other hand, has it much easier. With just two values, it first finds the circle’s centre in the coordinate system and then determines its circumference by adding the radius value to the circle equation: (x-a)²+(y-b)²=r². These values are all the vector file needs to draw the circle. Should we then want to enlarge it, the vector file simply replaces the radius value with a new one and draws the result of the new calculation. This much easier method requires very little disk space and permits infinite enlargement without concomitant deterioration of the resolution. The line edges will always look sharp and the image appear – and technically be – brand new.

That the image is redrawn every time it is altered or enlarged means that it can be divided into individual components. These can be separated, arranged, modified and colourised as needed with just one or very few clicks. A graphic designer can make them any size, they can continually be assigned any Pantone colour number, and their simpler compositions ultimately make them easier to apply to the textile. A vector file is accordingly much more versatile and easier to work with than a raster file. What it lacks in photorealism, it makes up for in responsiveness, and in an industry where looming deadlines are the rule rather than the exception, the importance of fast and flexible image editing cannot be overstated.

Identify your image’s file type
What file type is the image you hope to use as source for your logo? Find out by looking at the file extensions or by enlarging the image and seeing how it affects the quality. If the quality deteriorates, it is very likely a raster file.

The most common raster file formats have the extensions .jpg, .gif, .bmp, .png, .tiff, .tif and .psd (Photoshop), while the most common vector file formats have the extensions .eps, .ai, .cdr, .svg and .wmf/emf.

Summary
Let’s tie things up by recapitulating what we now know about raster and vector:

Both file types possess clear advantages. Raster is the preferred file format for realistic and colourful image renderings, while vector is the domain of the utilitarian, undemanding facsimile. Raster is used for photographs and is by far the most used image type on the internet, while vector is widely used in the design of logos with an eye towards marketing. Raster is luxurious, but demanding. Vector is ascetic, but smooth. Raster is a Gustave Courbet painting. Vector is an Albert Uderzo drawing. In the textile printing industry, the fast and easily editable option is preferred, which is why we at ID UNLIMITED prefer submitted images to be in vector format. We know it gives the shortest production times, the cheapest logos and the happiest customers.

Thank you for reading.