This ppt's introduced Basics of computer graphics, which helps to diploma in computer engineering, DCA BCA, BE computer science student's to improve study in computer graphics.
1. CHAPTER 1:-
Basic of Computer Graphics
Created by : Mr. Krishna g G. Jadhav
RLPC Buldhna,
Contact:-kparth.jadhav@gmail.com,7875075068
2. INTRODUCTION:-
•The term Computer graphics includes almost everything on the
computers that is not text.
•Today‟s we are touch lot‟s of computer generated graphics in our
daily life. Ex. Weather report on television, newspapers etc.
• The computer is called data processing machine, or we can say it is a
too which performs storing, processing and manipulating data. Ex.
Performing arithmetic operations and collect and generate data
according to user‟s need.
•A machine can easily generate hundred lines of code or thousands
entries of table. At this stage Computer graphics very useful, because
reader can‟t understand lines of code. Etc.
3. DEFINITION:-
Computer Graphics is the study of technique to improve the
communication between human and machine.
In above definition:
The word computer Graphics means picture, graph, or scene
is drawn with help of computer.
Computer Graphics allows communication through pictures,
charts and diagrams, as there is old adage “thousand words
can be replaced by a single picture.
4. APPLICATIONS:
•Engineering and/Scientific S/W, Business S/W.
•T.V. channels, Space simulation training.
•PCB designing, map preparation.
•User interface, animation.
•Making charts, Image processing.
•Office automation.
•Desktop Publishing.
•CAD/CAM
•Art & Commerce.
•Process Controlling.
•‘Visual effects ‘ in movies and Computer Games.
5. DISPLAY / VIDEO ADAPTERS:
A video adapter or display adapter is an integrated circuit card in a
computer that provides digital to analog converter, video RAM and a
video controller so that data can be sent to a computers display.
Figure:
6. Display adapters are characterized by:
1. Resolution: it refers to the no. of dots on the screen.
It is expressed as a pair of no‟s that give the no. of dots on
horizontal line and vertical lines. For example:
640X480,1024X768.
•Computer display generates colors by combining amounts of
Red, Green , and blue. these colors are controlled by 3 wires in
the display cable. Each has variable amount of voltage
represented by a number from 0 to 255. this up to 16 million
possible colors.
7. 2. Color Depth:
•It is determined by the no. of bits assigned to hold color
value. For example: 1 bit= 2 colors(Black & white)
4 bits= 16 colors,8 bits= 256 colors,16 bits= 32 thousands
colors,24 bits=16 million (high colors),32 bits= latest(true
color).
The display adapter stores a value (4 to 32 bit) in memory for
every dot on the screen. The amount of storage needed is
determined by multiplying the no of dots(Resolution) by the
memory required for each dot.
•For Eg. VGA having resolution 640X480 with 4 bit color 256 KB
memory is required.
8. 3.Referesh Rate:
• It determines the speed of that display uses to paint
the dots on the screen. The original VGA display run
at 70Hz
• A utility program is typically provided on diskette to
set the refresh rate on the display adapter for various
resolutions.
4.Acceleration:
• It Can draw lines and boxes, fill background color, scroll
text and manage the mouse pointer.
• With an accelerator only CPU has to send the video adapter
a command to draw lines.( with may include starting ,ending
point and width, color of line.
• An accelerator card reduces the amount of data that must be
transferred between PC & display (video)adapter.
9. •Modes: Many display adapters support several
diff. modes of resolution these are:
1. Text Mode or Character Mode.
2. Graphics Mode.
1. Text Mode: this video mode display screen is divided in to
rows and column's of boxes. Each box can contained one
character.
•Including all VGA video standards
25 Rows PC ,Supports a text mode that
divides the screen in to 25 rows &
80 Columns.
•Display Screen treated as an
Array of block. Each can be hold
one ASCII Character.
80 columns
10. 2. Graphics Mode: this video mode display screen is divided in
to an array of pixel.
1. Pixel is the smallest addressable element screen.
2. Each pixel has name or address,so that we can uniquely identify
that .
3. Programs that run in graphics mode can display an unlimited
variety of shapes and fonts, whereas program running in text
mode are severely limited.
4. Programs that runs entirly in graphics mode are called graphics
based programs
480
640
11. Graphics Mode function: If we want start graphics
programming then we need to files which GRAPHICS.H &
GRAPHICS.LIB. These files provided as part of turboc C and C++.
The graphics mode function required a graphics monitor and
adapter card such as CGA,EGA & VGA.
For Eg. /* sample example to draw line*/
#include<stdio.h>
#include<graphics.h>
void main()
{
int gd = DETECT,gm;
initgraph(&d ,&gm,” C:/tc/bgi”);
Line(200,200,100,100);
closegraph( );
restorecrtmode( ) ;
}
12. Graphics Mode function:
1) Basic Graphics mode function:-
1).initgraph( ):- it is used to initialized graphic mode.Syntax:- initgraph(int gd,int
gm, “path”).
gd(Graphics Driver):- this is the argument specifies the graphics driver to be
used and it interfaces with display adapter. Some available graphics driver are
CGA,EGA,VGA
gm (Graphics Mode):- Each graphic adapter can use several diff possoble graphics
modes. The mode argument is used to select particular mode.
path:- It specifies path to graphics driver. Graphics drivers are files with BGI file
extensions. The path name is string threfore it must be surrounded by quotes.
DETECT : is a macro which automatically select driver.
Eg. int gd = DETECT,gm;
initgraph(&d ,&gm,” C:/tc/bgi”);
2). closegroup( ): it is used to close graphics mode. Closegraph function restores the
previous display mode. Syntax:- closegraph( );
13. Graphics Mode function:
2) Shapes:- In computer graphics has many inbuilt commands, which can be used either to draw a
shape and/or for filling a colour in any bounded shape.
1) lineto( ):- This command draws a line on sceen from current cursor position
to the x,y position. Syntax :- lineto(x,y);
2) line ( ): this command draws line on screen. Syntax(x1,y1,x2,y2);.
3)circle( ):- Draws a cirlce on screen. Syntax:- circle(x,y,r);
4) Rectangle( ): draws a rectangle on screen. Syntax rectangle(x1,y1,x2,y2);
5) ellipse( ): draws ellipse on screen. Syntax :- ellipse(x,y,start,end,xrad,yrad);
x,y are the co-ordinates of center point.
Start, end- starting & ending angle of ellipse.
xrad,y,rad- x-axis and y axis radious respectively.
6) drawpoly( ): It draws outline of polygon having specified no of sides.
Syntax:- drawpoly( n,array), where n is no of vertices of polygon.
Array is integer array name which stores co-ordinates of vertices of a polygon
Eg:- drawpoly(4,p), int p[8]=[10,10,40,40,60,60,100,100]
14. Text Mode function:
We had seen, text mode screen is divided in to characters position. Screen
is mapped as no of rows and no of columns,.
Graphic function of Text mode:- 1) Window:- This function specifies a window
on screen. Syntax:- Window(left,top,right,bottom);
2) putch( ): it displays a single character at a cursor position. Eg. putch(„char‟)
3) clrscr( ): It clears the entire screen and locates the cursor in top left corner
of screen.
4) gotoxy( ):- it positions the cursor to the specifies location on screen, where location
is specified by the x,y co-ordinates of the point. Syntax(gotoxy(x,y).
5) puts( ):- It display string at cursor position. Syntax :- puts(s1);
6) textcolor( ):- It sets the color for text. Any text display after this command will be
displayed in colour specified by this command. Syntax:- textcolor(color); .
Eg. :- int col=2; textcolor(col);
15. Text mode graphic function supported following colors are no from 0 to 15.
Colour Colour Colour Colour Colour Colour Name Color Colour
constant Name const. Name const. const. Name
0 BLACK 5 MAGENTA 10 LIGHTGREEN 15 WHITE
1 BLUE 6 BROWN 11 LIGHTCYAN
2 GREEN 7 LIGHTGRAY 12 LIGHTRED
3 CYAN 8 DARKGRAY 13 LIGHTMAGENTA
4 RED 9 LIGHTBLUE 14 YELLOW
7). delline( ):- It deletes a line specified by cursor position. After deletion, all
subsequent line will be pushed up by one line. Eg. gotoxy(4,5); delline( );
8) . inline( ):- It insertes a blank line at current cursor position. Eg. gotoxy(4,5);inline(
);
9). textbackground( ):- It changes background colour of text. The valid colour for
CGA are from 0 to 6 in above table.
10). moveto( ):- It moves cursor to the location specified by int(x,y) co-ordinates.
11)outtextxy( ):- It displays text within quation mark at specified location with latest
set colour style. Eg. outtextxy(x,y,”sentence”);
16. GRAPHICS.H : Header files contains definitions of all the graphic
functions and constants. While GRAPHICS.LIB file contains
standard graphics function.
/* sample example to draw line*/
#include<stdio.h>
#include<graphics.h>
void main()
{
int gd = DETECT,gm;
init graph(&d ,&gm,” C:/tc/bgi”);
Line(200,200,100,100);
closegraph( );
restorecrtmode( ) ;
}
17. Graphics Devices:
1. Joysticks: A joystick is nothing but a small vertical lever which
is usually called as stick mounted on the base and is used to move
the cursor on the screen. It consist of two potentiometers
attached to a single lever. As we move the lever, the
potentiometer setting get changed and the X and Y coordinates on
screen get changed.
2. Track ball: Track ball is some sort of an inverted mouse where the
ball is held inside the rectangular box. the positioning of the
cursor is associated with orientation of the trackball.
3. Mouse: (Every one known about the mouse)
4. Light pen: Light pen consist of photocell mounted in a pencil like
case. It is a pencil shaped device which is used to point a
particular position on the screen .
18. Graphics Devices:
5. Touch panels: Touch panel allow displayed object or
screen positions to be selected with a touch of finger.
1. Optical touch panels employ a line of infrared light
emitting diodes(LED) along one vertical and one
Horizontal edge of the frame. The opposite vertical and one
horizontal edge contains light detectors. These detectors
are used to record which beams are interrupted when the
panel is touched. The two crossing beams are interrupted
identify the horizontal and vertical coordinates of the
screen positioned selected.
19. Graphics Devices:
•Electron gun generates a
6. CRT: basic arrangement of CRT:. beam of electrons which passes
through focusing and deflection
system and strikes on specified
position on phosphor coated
screen. When electron beam
strikes phosphor that phosphor
that phosphor spot emits light
and thus the point on screen is
visible.
•Focusing system makes
electron beam extremely finely
focused and makes highly
concentrated small spot when it
Basic Construction of CRT strikes phosphor.othrwise beam
will spread when it reaches the
screen.
20. Electron Gun:
Electron gun consist of heating fillament,cathode and control grid. when
cathode is heated with heating filament inside it by passing current through
filament, cathode generates electrons.Cathode is surrounded by metal control
grid with a hole at one end which allows electrons to escape. Intensity of
electron beam is controlled by setting voltage levels on control grid. A high
negative voltage applied to control grid will shut of beam by repelling and
stopping them from passing through small hole at the end of control grid.
21. •Raster scan CRT:-
•In this electron beam moves all over the screen one row at a time.
•As electron beam moves across each row, beam intensity is turned
ON and OFF to create picture pattern.
•Here picture definition is stored in memory called as refresh buffer
or frame buffer.
•This refresh buffer holds set of intensity values for all screen points.
These stored intensity values are tried from buffer and displayed on
screen one row at a time. When beam is moved from left to right, it is
ON and when moved from right to left it is OFF.
22. •Raster scan CRT:-
•Raster scan may use non-Interlace or interlace technique to display
picture.
• In non-interlaced, electron beam scans through each line by line.
•In interlaced techniques, beam firstly scans through even lines and
then odd scan lines thus scanning screen twice, beam scans through
alternated line first and then through remaining alternated lines.
Fig. Non-Interlace Fig. Interlace
23. •Random scan display:-
•Random scan display uses the technology to draw directly the
pictures on the screen. The beam is displayed on the positions where
the picture has to be displayed .
•Random scan monitors draw a picture one line at a time and for this
reason are also referred to as vector display.
•Refresh rate depends on the number of lines to be displayed. Picture
definition is stored as a set of line drawing commands in an area of
memory referred to as the refresh display file.
Advantages: 1) it has very high resolution and limited only by the
monitor.2) In random scan, easy animations are possible.3) It requires
less memory.
Disadvantage:- 1)It requires processor controlled beam.2) It cannot
draw a complex image as it has limited density. 3) it is very expensive
in terms of color.
24. •Difference between Raster and Random scan display:-
Raster Scan Random Scan
•It Stores Information in memory area •It Stores information in memory area
called refresh buffer or frame buffer called the refresh display file
•To display information the electron beam •To display a specified pictured the
return to the left side of the screen to begin system cycles through the set of
displaying the next scan line at the end of command in the display file, drawing
each frame, the electron beam returns to
each component line in turn. After all
the top left corner of the screen to begin the
next frame. line drawing commands have been
processed, the system cycles back to
the first line command in the list.
•Scan conversion is not required Scan conversion is required
•Scan conversion hardware is not required Scan conversion H/W required.
•Cost is low Cost is more
•Raster display has abilityto display areas Random scan display draws only lines
filled with solid colours or patterns. and characters.
25. •Frame Buffer:-
•A frame buffer is large contiguous piece of computer memory which is used to store the
display image..
•The diff kinds of memory used for frame buffers are disk, IC shift registers, drums etc.
•To display a pixel on raster display, minimum 1 bit is used in frame buffer for text to
maximum 24 bit in a frame buffer for graphics.
•When 1 bit is used to generate a pixel, the picture will be Black and white(0 & 1).
•A frame buffer stores information in digital form while raster display requires voltage to
generate pixel. A single bit frame buffer raster CRT display is as following fig.
D
O A
C
Electron Gun
Information
Raster Display
Frame buffer
DAC:- Digital to Analog Converter
26. •Frame Buffer Continued:-
•If the bits are increased from 1 to n then 2n intensity level can be achieved, for this, all the
n bits are checked and resulting value is calculated. This value is given to DAC to generate
appropriate voltage to set intensity of the pixel on the raster
1
D
0 A
C
Electron Gun
1
Information 2n
Raster Display
N Frame buffer
DAC:- Digital to Analog Converter
27. •Rotating memory Frame Buffer Continued:- Drums and disks
were widely used in frame buffers to store the image information.
• It is required to be refreshed continuously. Thus, it is necessary to read the disk or
drum again and again to refresh display.
•For this the rotating speed is made to coincide with the refresh rate of the screen.
•To generate a pixel of desired intensity or colour, it is first necessary to read the disk or
drum.
•The information stored in disk or drum is in digital form, hence it is necessary to convert
it into analog form using DAC and then this analog signal is used to generate the pixel.
•If only one bit is used to generate the pixel then only black and white picture is possible.
•Disadvantage:- 1) the cost of the memory is high. 2) It requires more time due to latency
problem.
Disk D
or A
Drum C Electron Gun
Digital Screen
Information
Analog signal
28. •Shift register Frame Buffer :-
•It is IC, the problem with the rotating memory is that it is slow and expensive while IC-
shift register can perform the same task with better speed and is less expensive.
•In this circuit, when pulse is applied, the content of memory are shifted by one place
removing the last bit and inserting it into the starting bit.
•It is rotating the information in a circular form.
•In this, one bit of memory is used as an intensity value.
•For color or gray scale display more than one IC, shift register can be used in parallel.
•Disadvantage: 1.It requires more time due to latency problem.2)In shift-register, even small changes requires
more time.
0 0 0
1 1 1 1
Direction of D
rotation 1 0 1
0 A
0 0 0 C
Electron Gun
0 0 0 1
Information
Raster Display
DAC:- Digital to Analog Converter
29. •Random Access Frame Buffer :-
•Frame buffers are made up of random access circuit, and the color or gray scale of the pixel
can be set by 1,2,4,8 or more bits.
•1 bit is generally used in text generation and any simple 2-D graphics figures like square,
triangle.
•To fill up the graphics figure, 2 to 4 bits of information are required for diff types of
shading effects while 8 or more bits are used for high quality graphics.
•In color display 3 guns are used for 3 primary colors .E.g.- Red, Green, Blue, one for each.
Red Electron
D Gun
A
R C
D
G A Green Electron
Gun
C
D BlueElectron
B A Gun
C Screen
Analog signal
30. •Random Access Frame Buffer continued:-
•Another method uses a colour map. The digital information from the frame buffer is
consider as address to a colour map table.
•8 bits are used hence it is possible to address 256 colour map table where colour component
is defined with high precision, it gives better results.
R G B Red Electron
D Gun
A
R C
D
G A Green Electron
Gun
C
D BlueElectron
B A Gun
C Raster Display
Analog signal
31. •Colour CRT Monitor:-
•A Color CRT can display colour pictures by using combination of
phosphor that emits diff. coloured lights. Diff. colours are produced
by combining emitted color light from diff. phosphor.
The two basic techniques used for producing colour display on CRT are:
1).Beam Penetration techniques 2).Shadow Mask CRT
•1) Beam Penetration Techniques: It is used with random scan monitors. In
this,normal CRT screen is coated with two phosphor layers. Here red
phosphor layer is deposited behind green phosphor layer. A slow electron
beam excites only red phosphor layer and thus produces only red trace. A very
fst beam penetrates through red layer and excites green layers also & thus
gives green trace. A beam accelerating voltage controls the speed of beam and
hence produces diff. screen colour display.
•Drawbacks: 1)Limited Rage of colours are produced.
•2). Need to change beam accelerating voltage, which is difficult.
32. •Shadow Mask CRT :- It Can display much wider range of
colours than beam penetration techniques.
•In this type of CRT a metal plate having small round holes in a triangular
pattern call shadow mask is inserted behind phosphor layer.
Red spot
Green spot
Blue spot
Electron
Gun
Shadow
mask Screen
Fig. Shadow mask CRT
33. •Direct view storage tube(DVST) :- It Consist of two
electron guns as writing gun & flood gun. Writing gun stores picture pattern
as a positive charge on storage grid.
•This picture pattern is transferred to phosphor by continuous flood of
electron generated from flood gun.
•Flood electrons passes through collector which smoothes out flow of
electrons. Electrons passes through collector at low speed and are attracted by
positively charged picture pattern on storage grid and are repelled by rest.
Flood
Electrons
Focusing and The attracted electrons by positive
defelection system
picture pattern pass right through
it and strike on phosphor making it
Flood gun visible screen.
Screen
Fig. DVST
Electron Writing
Gun beam
Collector
Storage Grid
34. •Flat panel Display:-
•Flat panel display devices are very thinner than CRT.
•These display devices have low volume,weight and power requirement as
compared to CRT.
There are two types display.
•1)Emissive Display:- These devices convert electrical energy into light. Eg.
Plasma panels, LED etc.
•2)Non-Emissive display:- They use optical effects to converts sunlight or light
from some other source in to graphics patterns. E.g. LCD.
35. •Plasma panels:-
•It Consist of two sheets of glass with thin and closed spaced grid electrodes
attached to inner faces and covered with dielectric material. These are
attached as series of vertical conductors on one glass plate and horizontal on
other glass plate.
•The space between two glass plate, is filled with neon gas and is sealed. By
applying voltage between electrodes the gas within panel is divided into tiny
cells and each cell is independent of it‟s neighbors. firing voltage applied to
Horizontal Pair 0f horizontal and
conductos/electrodes vertical conductors
Gas cause the gas at
panel Glass Plate
intersection cell to
break down into
Cell
glowing plasma.
Glass Plate
vertical conductors
/electrodes
Fig. Plasma panel Display
36. •Plasma panels:- contd…
•Merits:-
•1) light weight,less bulky device.
• 2)produces flicker free image.
• 3) refreshing is not required.
•4) it allows selecting erasing and writing.
•Demerits:-
•1)poor resolution
•2) It needs complex addressing and wiring.
• 3) Costly.
37. •LCD(Liquid crystal Display:-
•This display use thread like liquid crystal compounds that tend to
keep the long axes of rod shaped molecules aligned. These nematic
compounds have crystalline arrangement of molucules,yet they flow
like a liquid and hence termed as liquid crystal display.
•In following figure, two conductors defines a pixel position. Normally
the molecules are aligned as shown in the “On State”
Transparent
Conductor
Nematic Liquid crystal •Polarized light passing through
the material is twisted so that it
will pass through the opposite
polarizer.
•The light is then reflected back
to the viewer. To turn off the
pixel, apply a voltage to the two
intersecting conductor to align
Polarizer
the molecules so that light is not
Transparent conductor
On State twisted.
38. •Primitive Operations:-
•Most of graphics systems provide basic set of graphic primitive commands.
•Graphic primitives are the functions that we use to draw actual lines and the
characters that make up the picture. These functions provide convenient
method to application programmer for describing pictures. Basic three main
primitive functions are:
•Move to(x,y):- It used to set the current beam position to (x,y). It moves beam
from previous current position to (x,y) position without drawing line.
•Line to(x,y):- It used to draws line from current beam position to the point
(x,y).
•Draw text(s):- It used to displays the string „s‟ with its lower left corner at
current beam position and reset current beam position to string‟s lower right
corner.
39. •Display file Interpreter:-
•In raster scan display image information stored in frame buffer. Here frame buffer
stores intensity values of all pixel on screen. Whereas in vector refresh display only line
commands necessary to make picture are stored. These line commands are stored in file
is called display file.
• Picture image is firstly stored in display file in form of commands and then
some program executes these commands and convert these commands in to
actual picture is called display file interpreter, and it serves as interface
between graphics program and display device..
User Program Interpreter
Display file Display File
Fig:- Display file Interpreter
40. •Display file Structure:-
• Display file contains series of commands required to draw a required picture. These
commands are made up of two parts as-
• i) Operation code(op code) :- Op code identifies what type of command it is and
operands provide co-ordinates of pint(x,y) to process command. Each command needs
three array to store itself in display file. First Array (DF-OP[ ]) stores op code, second
array (DF- X[ ] ) stores x co-ordinate and third array (DF- Y [ ]) stores y- co-ordinate of a
point. For eg. DF-OP[3], DF- X[3] and DF-Y[3]. Before starting to write a series of
commands we shall assign come op codes to commands. We consider here only two
commands LINE and MOVE. Lets define OP code 1 for MOVE and 2 for LINE.
•ii) Operands.
DF-OP DF-X DF-Y
1 3 3
2 3 3
1 10 10
2 10 10
Fig:- Display file Structure
41. •Graphics File Format:-
1. TIFF( Tagged Image File Format): it is a flexible,adaptable file format for
handling images and data within a single file, by including the header tags (size
definition etc.) defining the image‟s geometry.
• A TIFF file also include a vector-based clipping path (outlines,cropping,image frames).
• A TIFF file a useful image archive,because,unlike standard JPEG files, a TIFF file using
lossless compression may be edited and re-saved without losing image quality.
• A TIFF file is a sequences of 8 bit bytes where bytes are numbered from 0 to N.
• Advantage:- 1) it is platform independent 2) It is independent of computer system also.
• 3) It is versatile and flexible. 4) It supports many compression schemes. 5) It supports
additional information about images.
• Disadvantage:- 1) It does not support multiple images in one file. 2) Complex file
format. 3) It is open ended format, hence programmer can make changes
42. 2) PCX:
•It is developed by ZSOFT for its PC Paintbrush program. PCX is a widely
used format for storing images.
•It is graphics file format for graphics programs running on PC‟s. It is
supported by most optical scanners, fax programs, and desktop publishing
systems. Files in the PCX format end with a “.pcx”
•The PCX is a device-independent raster image format. The file header stores
information about the display hardware(screen resolution, color depth and
palette information. Etc.) separately from the actual image information,
allowing the image to be properly transferred and displayed on computer
systems with diff. hardware.
•Advantages:- It is most widely used bitmap image format.
•Disadvantage:- 1)It has no provision for gray scale image.2) No provision for
any colour made other than RGB. 3) does not support other platform.
43. 2) JPEG (Joint Photographic Expert (Group):
•Image files that employ JPEG compression are commonly called “JPEG files”.
•JPEG is a lossy compression techniques in which some amount of data is lost.
•Lossy compression technologies attempt to eliminate redundant or unnecessary
information although it can reduce file sizes to about 5 % of their normal size,
some detail is lost in the compression.
•JPEG/JFIF is the format most used for storing and transmitting photographic
on the world wide web. For this application, JPEG/JFIF is far superior to GIF.
•The JPEG compression algorithm is not as well suited for line drawings and
other textual or iconic graphics.
•Advantages:- 1) suitable for photographic images.2) Reduces file size
•Disadvantage:- 1) Some information of image is lost.
44. 2) GIF(Graphic Interchange Format):
•It is simple, memory efficient and back bitmap format.
•It can be used with most bitmap editing programs. It compresses BMP files to
much smaller size.
•It sotres Image and other relevant information in sequence of blocks and sub
blocks where each sub-block has diff function regarding image information,
colour, brightness and data compression.
•This GIF allows high-quality,high-resolution graphics to be displayed on a
variety of graphics h/w and is intended as an exchange and display mechanism
for graphics images.
•Advantages:- 1) It gives compact file format.2) provids the option to specify
how many colours should be saved. 3) allows multiple image to be stored in a
single file. 4) suitable and are popular in Internet and Intranet. 5) It is device
independent. 6) It is operating System Independent.
•Disadvantage:- 1)Decompression of GIF data is slow.2) It uses only palette
colour. 3) It do not provide other RGB colour and Gray scale.
45. 2) BMP (Bitmap):
•It is default format used by MS- windows. Here, storing and manipulation of
pixels is done with their location and attributes by bit coding method.
•In this information is stored in Device-Independent- Bitmap format.
•Information can be displayed on any display device. It uses BMP as default fill
extension.
•The default filename extension of windows DIB file is BMP.
•BMP Structure:- It Contains a bitmap-file header, a bitmap-information
header, a colour table, and an array of bytes that defines the bitmap bits.
BITMAPFILEHEADER bmfh;
BITMAPINFOHEADER bmih;
RGBQUAD aColors[ ];
BYTE aBitmapBits[ ];
•Advantages:- 1) Simple to use. 2) It is display device independent.
•Disadvantage:- 1). Large file size 2) though display device independent they
are limited to window platform. 3) can not store multiple images in one file.
46. •Co –ordinate System:- •In 2D any point is address by it x & y co-
ordinates like fig a. where x co-ordinate is
1. Cartesian co-ordinate system:- distance of point from origin measured along x
direction and y co-ordinate is distance of a point
y from origin measured along y direction & where
x & Y are perpendicular to each other.
•In 3D Any point is addressed by its x,y,z co
ordinates as fig. b.
p
•Here in 2D & 3 D a line joining origin O to
point P a radius vector.
x
o y
y
p
x
p
o x
z