Vector graphics

Last updated

Example showing comparison of vector graphics and raster graphics upon magnification Bitmap VS SVG.svg
Example showing comparison of vector graphics and raster graphics upon magnification

Vector graphics are a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector display and printing hardware, vector data models and file formats, as well as the software based on these data models (especially graphic design software, computer-aided design, and geographic information systems). Vector graphics is an alternative to raster or bitmap graphics, with each having advantages and disadvantages in specific situations. [1]

Contents

While vector hardware has largely disappeared in favor of raster-based monitors and printers, [2] vector data and software continue to be widely used, especially when a high degree of geometric precision is required, and when complex information can be decomposed into simple geometric primitives. Thus, it is the preferred model for domains such as engineering, architecture, surveying, 3D rendering, and typography, but is entirely inappropriate for applications such as photography and remote sensing, where raster is more effective and efficient. Some application domains, such as geographic information systems (GIS) and graphic design, use both vector and raster graphics at times, depending on purpose.

Vector graphics are based on the mathematics of analytic or coordinate geometry, and is not related to other mathematical uses of the term vector. This can lead to some confusion in disciplines in which both meanings are used.

Data model

The logical data model of vector graphics is based on the mathematics of coordinate geometry, in which shapes are defined as a set of points in a two- or three-dimensional cartesian coordinate system, as p = (x, y) or p = (x, y, z). Because almost all shapes consist of an infinite number of points, the vector model defines a limited set of geometric primitives that can be specified using a finite sample of salient points called vertices. For example, a square can be unambiguously defined by the locations of three of its four corners, from which the software can interpolate the connecting boundary lines and the interior space. Because it is a regular shape, a square could also be defined by the location of one corner, a size (width=height), and a rotation angle.

The fundamental geometric primitives are:

A variety of more complex shapes may be supported:

In many vector datasets, each shape can be combined with a set of properties. The most common are visual characteristics, such as color, line weight, or dash pattern. In systems in which shapes represent real-world features, such as GIS and BIM, a variety of attributes of each represented feature can be stored, such as name, age, size, and so on. [3]

In some Vector data, especially in GIS, information about topological relationships between objects may be represented in the data model, such as tracking the connections between road segments in a transport network. [4]

If a dataset stored in one vector file format is converted to another file format that supports all the primitive objects used in that particular image, then the conversion can be lossless.

Vector display hardware

A free software Asteroids-like video game played on a vector monitor Space Rocks (game).jpg
A free software Asteroids -like video game played on a vector monitor

Vector-based devices, such as the vector CRT and the pen plotter, directly control a drawing mechanism to produce geometric shapes. Since vector display devices can define a line by dealing with just two points (that is, the coordinates of each end of the line), the device can reduce the total amount of data it must deal with by organizing the image in terms of pairs of points. [5]

Vector graphic displays were first used in 1958 by the US SAGE air defense system. [6] Vector graphics systems were retired from the U.S. en route air traffic control in 1999.[ citation needed ] Vector graphics were also used on the TX-2 at the Massachusetts Institute of Technology Lincoln Laboratory by computer graphics pioneer Ivan Sutherland to run his program Sketchpad in 1963. [7]

Subsequent vector graphics systems, most of which iterated through dynamically modifiable stored lists of drawing instructions, include the IBM 2250, Imlac PDS-1, and DEC GT40. There was a video game console that used vector graphics called Vectrex as well as various arcade games like Asteroids , Space Wars, Tempest and many cinematronics titles such as Rip Off , and Tail Gunner using vector monitors. [8] Storage scope displays, such as the Tektronix 4014, could display vector images but not modify them without first erasing the display. However, these were never as widely used as the raster-based scanning displays used for television, and had largely disappeared by the mid-1980s except for specialized applications.

Plotters used in technical drawing still draw vectors directly to paper by moving a pen as directed through the two-dimensional space of the paper. However, as with monitors, these have largely been replaced by the wide-format printer that prints a raster image (which may be rendered from vector data).

Software

Because this model is useful in a variety of application domains, many different software programs have been created for drawing, manipulating, and visualizing vector graphics. While these are all based on the same basic vector data model, they can interpret and structure shapes very differently, using very different file formats.

File formats

This vector-based (SVG format) image of a round four-color swirl displays several unique features of vector graphics versus raster graphics: there is no aliasing along the rounded edge (which would result in digital artifacts in a raster graphic), the color gradients are all smooth, and the user can resize the image infinitely without losing any quality. Vector-based example.svg
This vector-based (SVG format) image of a round four-color swirl displays several unique features of vector graphics versus raster graphics: there is no aliasing along the rounded edge (which would result in digital artifacts in a raster graphic), the color gradients are all smooth, and the user can resize the image infinitely without losing any quality.

Vector graphics are commonly found today in the SVG, WMF, EPS, PDF, CDR or AI types of graphic file formats, and are intrinsically different from the more common raster graphics file formats such as JPEG, PNG, APNG, GIF, WebP, BMP and MPEG4.

The World Wide Web Consortium (W3C) standard for vector graphics is Scalable Vector Graphics (SVG). The standard is complex and has been relatively slow to be established at least in part owing to commercial interests. Many web browsers now have some support for rendering SVG data but full implementations of the standard are still comparatively rare.

In recent years, SVG has become a significant format that is completely independent of the resolution of the rendering device, typically a printer or display monitor. SVG files are essentially printable text that describes both straight and curved paths, as well as other attributes. Wikipedia prefers SVG for images such as simple maps, line illustrations, coats of arms, and flags, which generally are not like photographs or other continuous-tone images.[ citation needed ] Rendering SVG requires conversion to a raster format at a resolution appropriate for the current task. SVG is also a format for animated graphics.

There is also a version of SVG for mobile phones. In particular, the specific format for mobile phones is called SVGT (SVG Tiny version). These images can count links and also exploit anti-aliasing. They can also be displayed as wallpaper.

CAD software uses its own vector data formats, usually proprietary formats created by the software vendors, such as Autodesk's DWG and public exchange formats such as DXF. Hundreds of distinct vector file formats have been created for GIS data over its history, including proprietary formats like the Esri file geodatabase, proprietary but public formats like the Shapefile and the original KML, open source formats like GeoJSON, and formats created by standards bodies like Simple Features and GML from the Open Geospatial Consortium.

Conversion

Original reference photo before vectorization Phone.jpg
Original reference photo before vectorization
Detail can be added to or removed from vector art. Phone.svg
Detail can be added to or removed from vector art.

To raster

Modern displays and printers are raster devices; vector formats have to be converted to a raster format (bitmaps – pixel arrays) before they can be rendered (displayed or printed). [10] The size of the bitmap/raster-format file generated by the conversion will depend on the resolution required, but the size of the vector file generating the bitmap/raster file will always remain the same. Thus, it is easy to convert from a vector file to a range of bitmap/raster file formats but it is much more difficult to go in the opposite direction, especially if subsequent editing of the vector picture is required. It might be an advantage to save an image created from a vector source file as a bitmap/raster format, because different systems have different (and incompatible) vector formats, and some might not support vector graphics at all. However, once a file is converted from the vector format, it is likely to be bigger, and it loses the advantage of scalability without loss of resolution. It will also no longer be possible to edit individual parts of the image as discrete objects. The file size of a vector graphic image depends on the number of graphic elements it contains; it is a list of descriptions.

From raster

Printing

Vector art is ideal for printing since the art is made from a series of mathematical curves; it will print very crisply even when resized. [11] For instance, one can print a vector logo on a small sheet of copy paper, and then enlarge the same vector logo to billboard size and keep the same crisp quality. A low-resolution raster graphic would blur or pixelate excessively if it were enlarged from business card size to billboard size. (The precise resolution of a raster graphic necessary for high-quality results depends on the viewing distance; e.g., a billboard may still appear to be of high quality even at low resolution if the viewing distance is great enough.) [12]

If we regard typographic characters as images, then the same considerations that we have made for graphics apply even to the composition of written text for printing (typesetting). Older character sets were stored as bitmaps. Therefore, to achieve maximum print quality they had to be used at a given resolution only; these font formats are said to be non-scalable. High-quality typography is nowadays based on character drawings (fonts) which are typically stored as vector graphics, and as such are scalable to any size. Examples of these vector formats for characters are Postscript fonts and TrueType fonts.

Operation

Advantages to this style of drawing over raster graphics:

For example, consider a circle of radius r. [14] The main pieces of information a program needs in order to draw this circle are

  1. an indication that what is to be drawn is a circle
  2. the radius r
  3. the location of the center point of the circle
  4. stroke line style and color (possibly transparent)
  5. fill style and color (possibly transparent)

Vector formats are not always appropriate in graphics work and also have numerous disadvantages. [15] For example, devices such as cameras and scanners produce essentially continuous-tone raster graphics that are impractical to convert into vectors, and so for this type of work, an image editor will operate on the pixels rather than on drawing objects defined by mathematical expressions. Comprehensive graphics tools will combine images from vector and raster sources, and may provide editing tools for both, since some parts of an image could come from a camera source, and others could have been drawn using vector tools.

Some authors have criticized the term vector graphics as being confusing. [16] [17] In particular, vector graphics does not simply refer to graphics described by Euclidean vectors. [18] Some authors have proposed to use object-oriented graphics instead. [16] [19] [20] However this term can also be confusing as it can be read as any kind of graphics implemented using object-oriented programming. [16]

Vector operations

Vector graphics editors typically allow translation, rotation, mirroring, stretching, skewing, affine transformations, changing of z-order (loosely, what's in front of what) and combination of primitives into more complex objects. [16] More sophisticated transformations include set operations on closed shapes (union, difference, intersection, etc.). [21] In SVG, the composition operations are based on alpha composition. [22]

Vector graphics are ideal for simple or composite drawings that need to be device-independent, [23] or do not need to achieve photo-realism. For example, the PostScript and PDF page description languages use a vector graphics model.

See also

Notes

  1. Nigel Chapman; Jenny Chapman (2002) [2000]. Digital Multimedia . Wiley. p.  86. ISBN   0-471-98386-1.
  2. Arie Kaufman (1993). Rendering, Visualization and Rasterization Hardware. Springer Science & Business Media. pp. 86–87. ISBN   978-3-540-56787-5.
  3. Vector Data Models Archived April 11, 2022, at the Wayback Machine , Essentials of Geographic Information Systems, Saylor Academy, 2012
  4. Bolstad, Paul (2008). GIS Fundamentals: A First Text on Geographic Information Systems (3rd ed.). Eider Press. p. 37.
  5. Murray 2002, pp. 81–83.
  6. Holzer, Derek (April 2019). Vector Synthesis: a Media-Archaeological Investigation into Sound-Modulated Light (PDF) (Thesis). Aalto University. urn:urn:NBN:fi:aalto-201905193156. Archived (PDF) from the original on April 18, 2021. Retrieved July 31, 2020.
  7. Kassem, Dalal (October 15, 2014). The Sketchpad Window (Thesis). Virginia Polytechnic Institute and State University. hdl:10919/63920 . Retrieved September 18, 2020.
  8. Wolf, Mark J. P. (2008). The Video Game Explosion: A History from PONG to Playstation and Beyond. ABC-CLIO. pp. 67–71. ISBN   978-0-313-33868-7 . Retrieved July 31, 2020.
  9. Peuquet, Donna J. (1984), "A Conceptual Framework and Comparison of Spatial Data Models", Cartographica 21 (4): 66–113. doi : 10.3138/D794-N214-221R-23R5. Archived October 24, 2021, at the Wayback Machine .
  10. Gharachorloo et al. 1989, p. 355.
  11. "Vector & Raster Graphics in Offset Printing". Olympus Press. December 6, 2013. Archived from the original on February 12, 2014. Retrieved June 16, 2014.
  12. "Printing and Exporting (Graphics)". COE Unix Network. June 18, 2002. Archived from the original on February 6, 2014. Retrieved June 16, 2014.
  13. "PNG vs. SVG: What are the differences?". Adobe. Retrieved December 12, 2023.
  14. "ASCIIsvg: Easy mathematical vector graphics". Peter Jipsen, Chapman University. Archived from the original on September 16, 2013. Retrieved June 16, 2014.
  15. Andy Harris. "Vector Graphics". Welcome to wally!!!. Archived from the original on May 18, 2012. Retrieved June 16, 2014.
  16. 1 2 3 4 Nigel Chapman; Jenny Chapman (2002) [2000]. Digital Multimedia . Wiley. p.  70. ISBN   0-471-98386-1.
  17. CS 354 Vector Graphics & Path Rendering Archived April 18, 2020, at the Wayback Machine , Slide 7, By Mark Kilgard, April 10, 2012, University of Texas at Austin
  18. Rex van der Spuy (2010). AdvancED Game Design with Flash. Apress. p. 306. ISBN   978-1-4302-2739-7.
  19. Ted Landau (2000). Sad Macs, Bombs and Other Disasters (4th ed.). Peachpit Press. p.  409. ISBN   978-0-201-69963-0.
  20. Amy Arntson (2011). Graphic Design Basics (6th ed.). Cengage Learning. p. 194. ISBN   978-1-133-41950-1.
  21. Barr 1984, p. 21.
  22. SVG Working Group (March 15, 2011). "SVG Compositing Specification". w3. Archived from the original on August 7, 2022. Retrieved August 8, 2022.
  23. Qin, Zheng (January 27, 2009). Vector Graphics for Real-time 3D Rendering (PDF) (Thesis). University of Waterloo. p. 1. hdl:10012/4262. Archived (PDF) from the original on July 28, 2020. Retrieved July 28, 2020.

Related Research Articles

<span class="mw-page-title-main">Raster graphics</span> Matrix-based data structure

In computer graphics and digital photography, a raster graphic represents a two-dimensional picture as a rectangular matrix or grid of pixels, viewable via a computer display, paper, or other display medium. A raster is technically characterized by the width and height of the image in pixels and by the number of bits per pixel. Raster images are stored in image files with varying dissemination, production, generation, and acquisition formats.

Scalable Vector Graphics (SVG) is an XML-based vector image format for defining two-dimensional graphics, having support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium since 1999.

<span class="mw-page-title-main">Raster graphics editor</span> Type of application software

A raster graphics editor is a computer program that allows users to create and edit images interactively on the computer screen and save them in one of many raster graphics file formats such as JPEG, PNG, and GIF.

<span class="mw-page-title-main">Vector graphics editor</span> Type of application software

A vector graphic editor is a computer program that enables its users to create, compose and edit images with the use of mathematical and geometrical commands rather than individual pixels. This software is used in creating high-definition vector graphic images that can be scaled indefinitely without losing their quality. The output is saved in vector graphic formats, such as EPS, ODG, or SVG.

<span class="mw-page-title-main">Rasterisation</span> Conversion of a vector-graphics image to a raster image

In computer graphics, rasterisation or rasterization is the task of taking an image described in a vector graphics format (shapes) and converting it into a raster image. The rasterized image may then be displayed on a computer display, video display or printer, or stored in a bitmap file format. Rasterization may refer to the technique of drawing 3D models, or to the conversion of 2D rendering primitives, such as polygons and line segments, into a rasterized format.

<span class="mw-page-title-main">Geometric primitive</span> Basic shapes represented in vector graphics

In vector computer graphics, CAD systems, and geographic information systems, geometric primitive is the simplest geometric shape that the system can handle. Sometimes the subroutines that draw the corresponding objects are called "geometric primitives" as well. The most "primitive" primitives are point and straight line segment, which were all that early vector graphics systems had.

Graphics are visual images or designs on some surface, such as a wall, canvas, screen, paper, or stone, to inform, illustrate, or entertain. In contemporary usage, it includes a pictorial representation of data, as in design and manufacture, in typesetting and the graphic arts, and in educational and recreational software. Images that are generated by a computer are called computer graphics.

A GIS file format is a standard for encoding geographical information into a computer file, as a specialized type of file format for use in geographic information systems (GIS) and other geospatial applications. Since the 1970s, dozens of formats have been created based on various data models for various purposes. They have been created by government mapping agencies, GIS software vendors, standards bodies such as the Open Geospatial Consortium, informal user communities, and even individual developers.

Cairo (graphics) Vector graphics-based software library

Cairo is an open-source graphics library that provides a vector graphics-based, device-independent API for software developers. It provides primitives for two-dimensional drawing across a number of different backends. Cairo uses hardware acceleration when available.

A computer font is implemented as a digital data file containing a set of graphically related glyphs. A computer font is designed and created using a font editor. A computer font specifically designed for the computer screen, and not for printing, is a screen font.

<span class="mw-page-title-main">Digital illustration</span> Use of digital tools to produce images under an artists direction

Digital illustration or computer illustration is the use of digital tools to produce images under the direct manipulation of the artist, usually through a pointing device such as a graphics tablet or, less commonly, a mouse. It is distinguished from computer-generated art, which is produced by a computer using mathematical models created by the artist. It is also distinct from digital manipulation of photographs, in that it is an original construction "from scratch". Photographic elements such as background or texture may be incorporated into such works, but they are not necessarily the primary basis.

A number of vector graphics editors exist for various platforms. Potential users of these editors will make a comparison of vector graphics editors based on factors such as the availability for the user's platform, the software license, the feature set, the merits of the user interface (UI) and the focus of the program. Some programs are more suitable for artistic work while others are better for technical drawings. Another important factor is the application's support of various vector and bitmap image formats for import and export.

An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be compressed or uncompressed. If the data is compressed, it may be done so using lossy compression or lossless compression. For graphic design applications, vector formats are often used. Some image file formats support transparency.

In computer graphics, image tracing, raster-to-vector conversion or raster vectorization is the conversion of raster graphics into vector graphics.

A region of interest is a sample within a data set identified for a particular purpose. The concept of a ROI is commonly used in many application areas. For example, in medical imaging, the boundaries of a tumor may be defined on an image or in a volume, for the purpose of measuring its size. The endocardial border may be defined on an image, perhaps during different phases of the cardiac cycle, for example, end-systole and end-diastole, for the purpose of assessing cardiac function. In geographical information systems (GIS), a ROI can be taken literally as a polygonal selection from a 2D map. In computer vision and optical character recognition, the ROI defines the borders of an object under consideration. In many applications, symbolic (textual) labels are added to a ROI, to describe its content in a compact manner. Within a ROI may lie individual points of interest (POIs).

<span class="mw-page-title-main">3D computer graphics</span> Graphics that use a three-dimensional representation of geometric data

3D computer graphics, sometimes called CGI, 3-D-CGI or three-dimensional computer graphics, are graphics that use a three-dimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering digital images, usually 2D images but sometimes 3D images. The resulting images may be stored for viewing later or displayed in real time.

<span class="mw-page-title-main">Computer graphics</span> Graphics created using computers

Computer graphics deals with by generating images and art with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. A great deal of specialized hardware and software has been developed, with the displays of most devices being driven by computer graphics hardware. It is a vast and recently developed area of computer science. The phrase was coined in 1960 by computer graphics researchers Verne Hudson and William Fetter of Boeing. It is often abbreviated as CG, or typically in the context of film as computer generated imagery (CGI). The non-artistic aspects of computer graphics are the subject of computer science research.

A geographic data model, geospatial data model, or simply data model in the context of geographic information systems, is a mathematical and digital structure for representing phenomena over the Earth. Generally, such data models represent various aspects of these phenomena by means of geographic data, including spatial locations, attributes, change over time, and identity. For example, the vector data model represents geography as collections of points, lines, and polygons, and the raster data model represent geography as cell matrices that store numeric values. Data models are implemented throughout the GIS ecosystem, including the software tools for data management and spatial analysis, data stored in a variety of GIS file formats, specifications and standards, and specific designs for GIS installations.

This is a glossary of terms relating to computer graphics.

<span class="mw-page-title-main">Boxy SVG</span> Vector graphics editor

Boxy SVG is a vector graphics editor for creating illustrations, as well as logos, icons, and other elements of graphic design. It is primarily focused on editing drawings in the SVG file format. The program is available as both a web app and a desktop application for Windows, macOS, ChromeOS, and Linux-based operating systems.

References