- 2D computer graphics
2D computer graphics is the
computer -based generation ofdigital image s—mostly from two-dimensional models (such as2D geometric model s, text, and digital images) and by techniques specific to them. The word may stand for the branch ofcomputer science that 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)printing anddrawing technologies, such astypography ,cartography ,technical drawing ,advertising , etc.. In those applications, the two-dimensionalimage is 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 than3D computer graphics (whose approach is more akin tophotography than totypography ).In many domains, such as
desktop publishing ,engineering , andbusiness , a description of a document based on 2D computer graphics techniques can be much smaller than the correspondingdigital 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 differentoutput device s. 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
PostScript language and theX Window System protocol were landmark developments in the field.2D graphics techniques
2D graphics models may combine geometric models (also called
vector graphics ),digital image s (also calledraster graphics ), text to be typeset (defined by content, font style and size, color, position, and orientation), mathematical functions andequation s, and more. These components can be modified and manipulated by two-dimensional geometric transformations such as translation,rotation , scaling.Inobject-oriented graphics , the image is described indirectly by an object endowed with a self-rendering method—a procedure which assigns colors to the imagepixel s by an arbitrary algorithm. Complex models can be built by combining simpler objects, in the paradigms ofobject-oriented programming .Direct painting
A convenient way to create a complex image is to start with a blank "canvas" raster map (an array of
pixel s, also known as abitmap ) filled with some uniformbackground color and then "draw", "paint" or "paste" simple patches of color onto it, in an appropriate order. In particular, the canvas may be theframe buffer for acomputer display .Some programs will set the pixel colors directly, but most will rely on some 2D
graphics library and/or the machine'sgraphics 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 simplegeometric shape , such as atriangle defined by three corners, or acircle with given center and radius;
* draw aline segment ,arc , or simple curve with avirtual pen of given width.Extended color models
Text, shapes and lines are rendered with a client-specified color. Many libraries and cards provide
color gradient s, which are handy for the generation of smoothly-varying backgrounds, shadow effects, etc.. (See alsoGouraud shading ). The pixel colors can also be taken from a texture, e.g. adigital image (thus emulating rub-onscreentone s and the fabled "checker paint " which used to be available only incartoon s).Painting a
pixel with a given color usually replaces its previous color. However, many systems support painting with transparent andtranslucent colors, which only modify the previous pixel values. The two colors may also be combined in fancier ways, e.g. by computing theirbitwise exclusive or . This technique is known asinverting color orcolor inversion , and is often used ingraphical user interface s 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.Layers
The models used in 2D computer graphics usually do not provide for three-dimensional shapes, or three-dimensional optical phenomena such as lighting,
shadow s, 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 editor s. Layered models also allow betteranti-aliasing of complex drawings and provide a sound model for certain techniques such asmitered joints and theeven-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 anintegrated circuit diagram, 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 image with 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
polyline s) may be broken down into simpler elements (characters orline segment s, respectively), which are then painted as separate layers, in some order. However, this solution may create undesirablealiasing artifacts wherever two elements overlap the same pixel.See also
Portable Document Format#Layers .2D graphics hardware
Modern computer
graphics card displays almost overwhelmingly use raster techniques, dividing the screen into a rectangular grid ofpixel s, 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. Aco-processor dedicated to blitting is known as a "Blitter chip".Classic 2D
graphics chip s of the late 1970s and early 80s, used in the8-bit video game console s andhome computer s, include:
*Atari 'sANTIC (actually a 2D GPU), TIA, CTIA, and GTIA
*Commodore/MOS Technology 's VIC and VIC-II2D graphics software
Many
graphical user interface s (GUIs), includingMac OS ,Microsoft Windows , or theX 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 ofwindow manager to 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 commoninput device s, 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 game s; and are still used for card and board games such assolitaire ,chess ,mahjongg , etc..2D graphics editors or "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 asdigital image s; 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 productsAdobe Illustrator andCorelDRAW , and the free editors such asxfig orInkscape . 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 image s, mainly by means of free-hand drawing/painting andsignal processing operations. 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'sMacPaint , companion toMacDraw . Modern examples are the freeGIMP editor, and the commercial productsPhotoshop andPaint Shop Pro . This class too includes many specialized editors — for medicine, remote sensing,digital photography , etc.Developmental animation
With the resurgence of 2D animation and its booming popularity, software like Toonz Harlequin, CelAction,
Anime Studio ,Toon Boom Animation , Animaker andAdobe Flash have 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
Retas andAdobe 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 isCacani , developed by Singapore'sNTU .ee also
*
3D computer graphics
*Bit blit
*Computer graphics
*Computer painting
*Graphic art software
*Graphics
*Image scaling
*List of home computers by video hardware
*Turtle graphics
*PostScript
* Transparency in graphics
* SVG
*Palette (computing)
*Pixel art
Wikimedia Foundation. 2010.