Computer Graphics representation description of objects creation of

Computer Graphics representation description of objects (creation of models) simulation reconstruction image processing

Description of an image vector raster (bitmap) image = an array of points image = a set of objects

I/O Devices Output devices raster – predominate display (800 600, 1024 768, 1280 1024…) ink and laser printers (300 dpi, 600 dpi) ink plotter vector pen plotter Input raster device for reading an image scanner digital camera

Bitmapped Image • points (so-called pixels – picture elements) arranged in a rectangular array · the only attribute of a pixel is the colour b/w (monochromatic) – 1 pixel 1 bit 16 colours 1 pixel 4 bits 256 colours 1 pixel 8 bits 224 colours (true colour) 1 pixel 3 bytes · the number of bits required for one pixel colour depth · the only thing possible to change – colour

Vector Images · a set of objects (lines, arcs, circles etc. ) · shapes are described in mathematical terms · objects have various properties (position, size, colour, type of line etc. ) · object’s properties can be changed easy

Colour Models are given by basic colours, rules for mixing of colours and by rules for changing other features

RGB the so-called additive model: · colours are added to the black one · adding colours forms a lighter colour · white = all colours; black = no colour · outside light is not necessary

CMY the so-called subtractive model: · colours are subtracted from the white one · adding colours forms a darker colour · white = no colour; black = all colours · outside light is necessary (the light is reflected from colour pigments) · in practise the model CMYK (K = black) is used

Model HSV Hue , Saturation , Value · hue – basic spectral colours; values are declared in degrees (0°– 360°) · saturation – the ratio of pure colour and white (100% – spectral colours) · value – brightness the high colour (100% ) has no touch of black decrease of brightness adding black · new colours are created by adding black and white to spectral colours


color white black red green blue yellow cyan magenta gray (50%) gray (tmavě) pink (50%) pink (25%) darkred brown 255 0 0 255 128 64 255 203 128 RGB 255 0 0 255 255 0 128 64 128 192 0 0 255 128 64 128 192 0 0 0 255 255 0 128 192 0 0 52 127 CMY 0 255 0 0 255 128 192 127 64 255 255 0 0 128 192 127 64 255 0° 0° 0° 120° 240° 60° 180° 300° 0° HSV 0% 0% 100% 100% 0% 0% 50% 25% 100% 0% 100% 100% 50% 25% 100% 80% 50%

Colour Palette (Colour look-up table)

Palette Colour Look-Up Table · defines how many and which colours are used in the image · colour of a pixel can be done either by values of primary components or by a number pointing to the look-up table of colours · criterion for using palette: required room in the storage · palette is used for 256 colours · palette is not used for true colours · advantage: colours in the image can be changed easy by changing the palette

Uniform palette (256 colours) 3– 3– 2 Red Green Blue 8 8 4 Other example of palette 7 x 12 x 3 7 shades of red, 12 shades of green a 3 shades of blue (252 colours) Adjusted colour palette optimised for one specific image

Example of a Usage of Palettes origin picture 24 bits per pixel palette 16 colours 4 bits per pixel palette 256 colours 8 bits per pixel adjusted palette 256 colours 8 bits per pixel

Graphic Editors

Bitmap Editors (Paint Programs) • creation and modification of bitmaps • drawing and modifications = change of a colour of pixels Examples: Paint, Corel Photo-Paint, Adobe Photo Shop Image Composer, Photo Styler, Photo Finish etc.

Tools of editors enabling drawing: · drawing by hand (pencil, pen, brush, spray) · drawing basic geometric shapes and text · setting of drawing colour, background colour, thickness of lines · filling with various colours and patterns · copying, movement, rotation, mirroring of a cut-out

Tools in editors oriented on modification of images (e. g. . photographs) enable: · modification of colours · change of a palette · modification of brightness and contrast · retouching tools – sharpening, blurring · impression of a pattern and other effects


Vector Graphics Programs (Draw Programs) drawing = creation of objects modification = change of object’s properties division from the viewpoint on specialization in drawing, graphics e. g. . Corel Draw, Adobe Illustrator in technical drawing – CAD systems e. g. . Auto. CAD, Microstation, Spirit from the viewpoint on 3 D drawing – 2 D programs 3 D programs

Ability of editors oriented on drawing: · drawing basic geometric objects and text · setting of line’s properties (colour, thickness, type) and fills (colour, pattern, texture, a progression between two colours) · selection of drawn objects · manipulation with selected objects: copying, movement, rotation, mirroring, change of size grouping, ordering, aligning, modification of curves · effects: adding perspective, envelope, blending objects, extruding objects, Power Clip, using lenses

envelope blending extruding Power Clip lens path

Properties of CAD systems (Computer Aided Design) · precise specification of a point · drawing lines, curves, basic geometric objects, text and hatch · selection of drawn objects · a great power to modify objects copying, movement, rotation, mirroring, change of size, trim, extension, . . . · dimensioning · layers · possibility to join the drawing to a database, libraries of elements

Editors enabling 3 D drawing • drawing 3 D objects and operations with them (union, intersection, subtraction) · visibility · setting of lights – location, type, intensity, colour types of lights: point light (a bulb) distant light (the sun) spot light (a spotlight) · shading, casting of a shade · setting of materials properties – colour, smoothness, metallic look, shine etc. · rendering – creation of a real 3 D image from a computer designed model

3 D model Prostorovývisibility model shading render

point light Druhy osvětlení distant light spot light

Rendering Render

Graphics File Formats

Bitmapped Formats · store image as an array of pixels · built-in compression · file consists of header – information about the image: identification of the format, width and height of the picture, colour depth etc. definition of the palette data – information about pixel’s colour (values of components or index into the palette)

Bitmapped Formats the most widespread : GIF, JPEG, BMP, TIFF, PCX advantages: • are easy created from data in memory • are easy transport to a raster output device disadvantages: • require a lot memory • a picture cannot be enlarged or reduced without losing quality

Vector Formats · include a description of objects creating the image · individual formats have different purpose and are very different · file consists of header vector data the most widespread : CDR (Corel. Draw) PLT, HPG (language HPGL, description for output devise) DWG (Auto. CAD) DXF, DXB (Auto. CAD)

Vector Formats advantages: • size of a file is proportional to a complexity of the image • a picture can be enlarged or reduced without losing quality • can be easy adjusted to an output device • some formats are saved as an ASCII text, so they can be processed by various ways disadvantages: • are not uniform • must be transformed for output devices

Metafiles · include both raster and vector data · individual formats are very different · designed for exchanging graphical data between different application programs · the most widespread: WMF EPS (language Post. Script, for print)
- Slides: 34