- 2D computer graphics
2D computer graphics is the
computer-based generation of digital images—mostly from two-dimensional models (such as 2D geometric models, text, and digital images) and by techniques specific to them. The word may stand for the branch of computer sciencethat comprises such techniques, or for the models themselves. 2D computer graphics are mainly used in applications that were originally developed upon traditional
Raster graphic sprites (left) and masks (right)
printingand drawingtechnologies, such as typography, cartography, technical drawing, advertising, etc.. In those applications, the two-dimensional imageis not just a representation of a real-world object, but an independent artifact with added semantic value; two-dimensional models are therefore preferred, because they give more direct control of the image than 3D computer graphics(whose approach is more akin to photographythan to typography).
In many domains, such as
desktop publishing, engineering, and business, a description of a document based on 2D computer graphics techniques can be much smaller than the corresponding digital image—often by a factor of 1/1000 or more. This representation is also more flexible since it can be rendered at different resolutions to suit different output devices. For these reasons, documents and illustrations are often stored or transmitted as 2D graphic files.
2D computer graphics started in the 1950s, based on vector graphics devices. These were largely supplanted by raster-based devices in the following decades. The
PostScriptlanguage and the X Window Systemprotocol were landmark developments in the field.
2D graphics techniques
2D graphics models may combine geometric models (also called
vector graphics), digital images (also called raster graphics), text to be typeset (defined by content, font style and size, color, position, and orientation), mathematical functions and equations, and more. These components can be modified and manipulated by two-dimensional geometric transformations such as translation, rotation, scaling.In object-oriented graphics, the image is described indirectly by an object endowed with a self-rendering method—a procedure which assigns colors to the image pixels by an arbitrary algorithm. Complex models can be built by combining simpler objects, in the paradigms of object-oriented programming.
A convenient way to create a complex image is to start with a blank "canvas" raster map (an array of
pixels, also known as a bitmap) filled with some uniform background colorand then "draw", "paint" or "paste" simple patches of color onto it, in an appropriate order. In particular, the canvas may be the frame bufferfor a computer display.
Some programs will set the pixel colors directly, but most will rely on some 2D
graphics libraryand/or the machine's graphics card, which usually implement the following operations:
* paste a given image at a specified offset onto the canvas;
* write a string of characters with a specified font, at a given position and angle;
* paint a simple
geometric shape, such as a triangledefined by three corners, or a circlewith given center and radius;
* draw a
line segment, arc, or simple curve with a virtual penof given width.
Extended color models
Text, shapes and lines are rendered with a client-specified color. Many libraries and cards provide
color gradients, which are handy for the generation of smoothly-varying backgrounds, shadow effects, etc.. (See also Gouraud shading). The pixel colors can also be taken from a texture, e.g. a digital image(thus emulating rub-on screentones and the fabled " checker paint" which used to be available only in cartoons).
pixelwith a given color usually replaces its previous color. However, many systems support painting with transparent and translucentcolors, which only modify the previous pixel values. The two colors may also be combined in fancier ways, e.g. by computing their bitwise exclusive or. This technique is known as inverting coloror color inversion, and is often used in graphical user interfaces for highlighting, rubber-band drawing, and other volatile painting—since re-painting the same shapes with the same color will restore the original pixel values.
The models used in 2D computer graphics usually do not provide for three-dimensional shapes, or three-dimensional optical phenomena such as lighting,
shadows, reflection, refraction, etc.. However, they usually can model multiple "layers" (conceptually of ink, paper, or film; opaque, translucent, or transparent—stacked in a specific order. The ordering is usually defined by a single number (the layer's "depth", or distance from the viewer).
Layered models are sometimes called "2 1/2-D computer graphics". They make it possible to mimic traditional drafting and printing techniques based on film and paper, such as cutting and pasting; and allow the user to edit any layer without affecting the others. For these reasons, they are used in most
graphics editors. Layered models also allow better anti-aliasingof complex drawings and provide a sound model for certain techniques such as mitered jointsand the even-odd rule.
Layered models are also used to allow the user to suppress unwanted information when viewing or printing a document, e.g. roads and/or railways from a
map, certain process layers from an integrated circuitdiagram, or hand annotations from a business letter.
In a layer-based model, the target image is produced by "painting" or "pasting" each layer, in order of decreasing depth, on the virtual canvas. Conceptually, each layer is first rendered on its own, yielding a
digital imagewith the desired resolution which is then painted over the canvas, pixel by pixel. Fully transparent parts of a layer need not be rendered, of course. The rendering and painting may be done in parallel, i.e. each layer pixel may be painted on the canvas as soon as it is produced by the rendering procedure.
Layers that consist of complex geometric objects (such as text or
polylines) may be broken down into simpler elements (characters or line segments, respectively), which are then painted as separate layers, in some order. However, this solution may create undesirable aliasingartifacts wherever two elements overlap the same pixel.
Portable Document Format#Layers.
2D graphics hardware
graphics carddisplays almost overwhelmingly use raster techniques, dividing the screen into a rectangular grid of pixels, due to the relatively low cost of raster-based video hardware as compared with vector graphic hardware. Most graphic hardware has internal support for blitting operations and sprite drawing. A co-processordedicated to blitting is known as a " Blitterchip".
graphics chips of the late 1970s and early 80s, used in the 8-bit video game consoles and home computers, include:
Atari's ANTIC(actually a 2D GPU), TIA, CTIA, and GTIA
MOS Technology's VIC and VIC-II
2D graphics software
graphical user interfaces (GUIs), including Mac OS, Microsoft Windows, or the X Window System, are primarily based on 2D graphical concepts. Such software provides a visual environment for interacting with the computer, and commonly includes some form of window managerto aid the user in conceptually distinguishing between different applications. The user interface within individual software applications is typically 2D in nature as well, due in part to the fact that most common input devices, such as the mouse, are constrained to two dimensions of movement.
2D graphics are very important in the control peripherals such as printers, plotters, sheet cutting machines, etc.. They were also used in most early video and
computer games; and are still used for card and board games such as solitaire, chess, mahjongg, etc.. 2D graphics editorsor "drawing programs" are application-level software for the creation of images, diagrams and illustrations by direct manipulation (through the mouse, graphics tablet, or similar device) of 2D computer graphics primitives. These editors generally provide geometric primitives as well as digital images; and some even support procedural models. The illustration is usually represented internally as a layered model, often with a hierarchical structure to make editing more convenient. These editors generally output graphics files where the layers and primitives are separately preserved in their original form. MacDraw, introduced in 1984 with the Macintosh line of computers, was an early example of this class; recent examples are the commercial products Adobe Illustratorand CorelDRAW, and the free editors such as xfigor Inkscape. There are also many 2D graphics editors specialized for certain types of drawings such as electrical, electronic and VLSI diagrams, topographic maps, computer fonts, etc.
Image editors are specialized for the manipulation of
digital images, mainly by means of free-hand drawing/painting and signal processingoperations. They typically use a direct-painting paradigm, where the user controls virtual pens, brushes, and other free-hand artistic instruments to apply paint to a virtual canvas. Some image editors support a multiple-layer model; however, in order to support signal-processing operations like blurring each layer is normally represented as a digital image. Therefore, any geometric primitives that are provided by the editor are immediately converted to pixels and painted onto the canvas. The name "raster graphics editor" is sometimes used to contrast this approach to that of general editors which also handle "vector graphics". One of the first popular image editors was Apple's MacPaint, companion to MacDraw. Modern examples are the free GIMPeditor, and the commercial products Photoshopand Paint Shop Pro. This class too includes many specialized editors — for medicine, remote sensing, digital photography, etc.
With the resurgence of 2D animation and its booming popularity, software like Toonz Harlequin, CelAction,
Anime Studio, Toon Boom Animation, Animaker and Adobe Flashhave emerged as the new tools of choice for both amateur and professional animators.
However, the principal issue with 2D animation is labor requirements. With advanced software like
Retasand Adobe After Effects, coloring and compositing can be easily done with significantly less time. Additional software is being developed to aid and speed up the process of digital 2D animation, specifically in the area of automatic coloring and in-betweening. One such example is Cacani, developed by Singapore's NTU.
3D computer graphics
Graphic art software
List of home computers by video hardware
* Transparency in graphics
Wikimedia Foundation. 2010.