Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 6 Graphics, Number Systems. 7.2 Bit-map Graphics Similar to real painting on the canvas, there is no way to change something but paint over it.

Similar presentations


Presentation on theme: "Lecture 6 Graphics, Number Systems. 7.2 Bit-map Graphics Similar to real painting on the canvas, there is no way to change something but paint over it."— Presentation transcript:

1 Lecture 6 Graphics, Number Systems

2 7.2 Bit-map Graphics Similar to real painting on the canvas, there is no way to change something but paint over it. Bit-mapped graphics become ragged when you shrink or enlarge them.

3 7.3 Paint pixels on the screen with a pointing device –Select painting tools from a tools palette –Create bit-mapped graphics –Realism of the images is determined by the amount of memory allocation per pixel –Resolution is determined by the density of pixels Painting: Bit-Mapped Graphics

4 7.4 The outlined areas can be filled with a color or with a pattern Painting: Bit-Mapped Graphics

5 7.5 You can edit high- resolution bit-mapped images –Select editing tools from a palette –Alter digitized photographs and graphics from paint programs Digital Image Processing: Photographic Editing by Computer

6 7.6 Image Formats BMP –The bit-mapped file format used by Microsoft Windows. TIFF (Tagged Image File Format) –A standard file format for storing images as bit maps. It is used especially for scanned images because it can support any size, resolution, and color depth

7 7.7 Image Formats (cont) GIF (Graphics Interchange Format) – A standard for digitized images compressed with the LZW algorithm (not image-specific, can be used for any data, in Unix a command compress). Allows for features such a transparent background, animation. Used in the Internet for small icon-like images.

8 7.8 Image Formats (cont) JPEG (Joint Photographic Experts Group) – JPEG is designed for compressing either full- color or gray-scale digital images of "natural", real- world scenes. It does not work so well on non- realistic images, such as cartoons or line drawings. JPEG does not handle compression of black-and-white (1 bit-per-pixel) images or moving pictures. Used in the Internet for photos.

9 7.9 Vector Graphics A vector image consist of objects such as lines, rectangles, circles, etc. that can be easily moved around and resized. An object is usually chosen by a mouse click, and could be resized by dragging its borders. Objects stay separate from each other all the time.

10 7.10 Vector Graphics Such properties of an object as line thickness, color, fill pattern can be easily changed after the object was created. Several objects may be grouped in on composed object. A composed object can be broken down to the original objects it was made from. Objects can be arranged in several layers, so that they overlap in a defined manner.

11 7.11 Drawing: Object-Oriented Graphics Draw the shapes of objects with a pointing device –The palette of drawing software differs from that of painting software

12 7.12 Drawing: Object-Oriented Graphics Shapes: –Are stored as formulas (text) describing how to draw that shape the allows infinite resolution and requires less memory –The shape formulas allow for infinite resolution of the image –The shape formulas also mean fewer memory demands

13 7.13 Image Formats Formats of drawing programs (e.g. xfig) PostScript, PDF – Graphics file format developed by Adobe Systems. Postscript is widely used on Unix for distributing and printing documents. Portable Document Format (PDF) is de- facto standard for documents in the Internet

14 7.14 Painting Pixels vs. Drawing Object Shapes Painting pixels: –More control over textures, shading and fine detail –Used to create screen displays (for video games, multimedia presentations, and Web pages)

15 7.15 Painting Pixels vs. Drawing Object Shapes Painting pixels: –Used for simulating natural paint media –Used to embellish photographic images

16 7.16 Painting Pixels vs. Drawing Object Shapes Drawing object shapes: –Better choice for creating printed graphs, charts, and illustrations with clean lines and smooth shapes

17 7.17 CAD/CAM: From Pictures to Products Engineers,architect, and designers use (computer-aided design) CAD software to design or manufacture products AutoCAD

18 7.18 Screen shot In Linux it is possible to save an image of whole display, a fragment of the display or a window using Grab-feature in the xv-program. In Windows it is possible to take save an image of the currently active window by pressing -, or of the whole display by pressing just. The image is then place into clipboard, and can be pasted for example into a WordPerfect document or into Paint program.

19 7.19 Number and Character Representation in Computers

20 7.20 A Bit About Bits A bit (binary digit) –is the smallest unit of information –can have two values - 1 and 0. Binary digits, or bits, can represent numbers, codes, or instructions. OnOff

21 7.21 Bits as Numbers Binary number system - a system that denotes all numbers and combinations of two digits. The binary system uses two digits to represent the numbers 0 and 1.

22 7.22 Bits, Bytes, and Buzzwords Common terms might describe file size or memory size: Bit: smallest unit of information Byte: a grouping of eight bits of information K: (kilobyte); about 1,000 bytes of information - technically 1024 bytes equals 1K of storage.

23 7.23 Bits, Bytes, and Buzzwords MB: (megabyte); about 1 million bytes of information GB: (gigabyte); about 1 billion bytes of information TB: (terabyte); about 1 million megabytes of information

24 7.24 Decimal System Humans have 10 fingers: count in DECIMAL Numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,... Use 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 We know that 5304 = 5*10 3 +3*10 2 +0*10 1 +4*10 0 Base 10

25 7.25 Binary System BINARY numbers: –0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011,.... Written with only 2 digits: "0" and "1" In the same way as for decimal, 1011 (binary) = 1*2 3 +0*2 2 +1*2 1 +1*2 0 = 11 (decimal) Base 2 Converting from binary to decimal is simple, just as for 1011 above.

26 7.26 Binary System (contd.) How to know if 1011 is in binary or in decimal? Subscripts are used to show the base: 1011 2 (binary number), 1011 10 (decimal number) Converting from decimal to binary a little bit more tricky, we skip this, check some book if you are interested. Large binary numbers are cumbersome to write

27 7.27 Hexadecimal System Heavily used in modern computers to represent binary data Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B,... Base 16 Again the same idea: – 1A 16 =1*16 1 +10*16 0 = 26 10

28 7.28 Hex (cont.) Groups of 4 bits 4 bits: 2 4 = 16 combinations...... use digits 0-9 and A, B, C, D, E, F Converting between binary and hex is straightforward: 1011110111 2 => 10 1111 0111 => 10(=2) 1111(=F) 0111(=7) => 2F7 16

29 7.29 Octal System Octal was used in computers with byte length of 6 bits Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20,... Base 8 Groups of 3 bits 3 bits: 2 3 = 8 combinations... use digits 0-7

30 7.30 Octal (cont.) Converting between binary and octal is straightforward: 1011110111 2 => 1 011 110 111 => 1(=1) 011(=3) 110(=6) 111(=7) =>1367 8 In UNIX chmod command takes absolute mode for file access rights in octal

31 7.31 Example Decimal Binary Octal Hex (base 10) (base 2) (base 8) (base 16) 0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F 35 10 0011 43 23 100 110 0100 144 64 255 1111 1111 377 FF

32 7.32 Bits as Codes ASCII - American Standard Code for Information Interchange - most widely used code, represents each character as a unique 7-bit code.

33 7.33 Character Tables ISO Latin1 –8-bit code –Extension to ASCII (ASCII is compatible) –Has characters for European languages Cyrillic –A dozen of different encodings –Mostly used: KOI8 for UNIX Windows-1251 Unicode (16 bits) includes ALL characters from ALL languages (!) Character Sets in browsers


Download ppt "Lecture 6 Graphics, Number Systems. 7.2 Bit-map Graphics Similar to real painting on the canvas, there is no way to change something but paint over it."

Similar presentations


Ads by Google