KONGU ENGINEERING COLLEGE, PERUNDURAI 638 060
20CSE14 Graphics and Multimedia
End Semester November2023
Answer Key
PART - A (10 × 2 = 20 Marks)
1. Write the operating characteristics of raster refresh systems.
In raster scan system electron beam sweeps across the screen, from top to bottom covering one
row at a time. A pattern of illuminated pattern of spots is created by turning beam intensity on and
off as it moves across each row. Each screen point is referred to as pixels.
2. Define the use of frame buffer.
A memory area called refresh buffer or frame buffer stores picture definition. This memory area
holds intensity values for all screen points. Stored intensity values are restored from frame buffer
and painted on screen taking one row at a time.
3. State composite transformation
Combination of two or more transformations into one single transformation that is
equivalent to the transformations that are performed one after one over a 2D/3D object.
Translation / Scaling /Rotation/ Reflection/ Shearing are the transformations applied on
2D/3D in a composite manner.
4. Write the basic transformation used to change the size and shape of 2D object.
Non-uniform Scaling change the size and shape of the given object.
Non-uniform Scaling scaling factor Sx is not equal to Sy
Example : For a square object with side=2 units and if the scaling factors are Sx=1 and
Sy=2, then scaling transformation will results with rectangle object with length=4 units and
with=2 units
5. Object Modelling
2D is to display length and height information on a flat surface without depth.
3D is defined as 3D drawings or models, they describe objects in terms of height, width,
and depth
3D modelling is the process of creating three-dimensional representations of an object or a
surface
6. CMYK stands for Cyan, Magenta, Yellow, and BLACK.
CMYK is used for business cards, stationary, stickers, posters, brochures etc
7. Multimedia is the presentation of text, pictures, audio, and video with links and tools that allow
the user to navigate, engage, create, and communicate using a computer.
Basic characteristics:
1. Multimedia systems must be computer controlled.
2. Multimedia systems are integrated.
3. The information they handle must be represented digitally.
4. The interface to the final presentation of media is usually interactive
8. MPEG- Moving Picture Experts Group
GIF- Graphics Interchange Format
JPEG- Joint Photographic Experts Group
MP3- MPEG-1 Audio Layer 3
9. Lossy and lossless compression
Lossy Compression Lossless Compression
A file does not restore or rebuilt in its
A file can be restored in its original form.
original form.
reduces the size of data. does not reduce the size of data.
Algorithms used Transform
Algorithms used: Run Length
coding, Discrete Cosine Transform,
Encoding, Lempel-Ziv-Welch, Huffman
Discrete Wavelet Transform, fractal
Coding, Arithmetic encoding etc.
compression etc.
used in Images, audio, video. used in Text, images, sound.
also termed as irreversible compression. also termed as reversible compression.
10. Formats used for representing audios. (any 4)
MP3, AAC, WMA, FLAC, ALAC, WAV, AIFF, and PCM
Part – B (4 × 10 = 40 Marks)
ANSWER ANY FOUR QUESTIONS
11. a.i. DDA algorithm
(X1,Y1)=(13,6) & (X2,Y2)=(3,10) are given
dx=X2-X1=3-13=-10 ---- 2marks
dy=Y2-Y1=10-6=4
M=dy/dx=4/-10=-0.4
Abs(dx)>abs(dy)steps=10 Xincr=dx/steps =-10/10=-1 Yincr=dy/steps=4/10=0.4
Xp,Yp=(13,6) & m<1=> Xp+1=round(Xp+1) & Yp+1=round(Yp+m)
NEXT POINTS ARE ----4 marks
Xp+1 , Yp+1 After rounding ,
Xp+1 Yp+1
12 ,6.4 12,7
11,6.8 11,7
10,7.2 10,7
9,7.6 9,8
8,8 8,8
7,8.4 7,8
6,8.8 6,9
5,9.2 5,9
4,9.6 4,10
3,10 3,10
a.ii Working of Raster scan CRT ----6marks
In raster scan system electron beam sweeps across the screen, from top to bottom
covering one row at a time.
A pattern of illuminated pattern of spots is created by turning beam intensity on
and off as it moves across each row.
A memory area called refresh buffer or frame buffer stores picture definition.
This memory area holds intensity values for all screen points.
2
Stored intensity values are restored from frame buffer and painted on screen
taking one row at a time.
Each screen point is referred to as pixels.
In raster scan systems refreshing is done at a rate of 60-80 frames per second.
At the end of each scan line, electron beam begins to display next scan line after
returning to left side of screen.
The return to the left of screen after refresh of each scan line is known as
horizontal retrace of electron beam.
At the end of each frame electron beam returns to top left corner and begins the
next frame.
Diagram ---- 4marks
b.i Midpoint circle drawing
Radius=6 & midpoint=(-1,1)
Assume centre=(0,0) & (X0,Y0)=(0,6)
P0=1-R=1-6=-5 ---- 2marks
IF PK<0 IF PK>=0,
----4marks
Pk Pk+1 (Xk+1, Yk+1) (Xplot,Yplot)
(0, 6) (-1,7)
-5 -2 (1, 6) (0,7)
-2 3 (2, 6) (1,7)
3 0 (3, 5) (2,6)
0 -3 (4, 4) (3,5)
3
b.ii Shadow mask color CRT monitor ---- 6marks
Shadow Mask Technique in Computer Graphics is commonly used in raster-scan systems
( including color TV) because they produce a much wider range of colors
A shadow mask CRT has 3 phosphor color dots at each pixel position. The first
phosphor dot emits a red light, the second one emits a green light and the third emits a
blue light.
The Shadow Mask Technique involves the usage of three electron guns, one for each
color dot, and a shadow-mask grid just behind the phosphor-coated screen.
To get color variations in a shadow mask CRT, the intensity levels of the three electron
beams are varied. By turning off red and green guns, it used to get only the color coming
from the blue phosphor. Other combinations of beam intensities generate a small light
spot for each pixel position since our eyes tend to merge the three colors into one
composite. The color we see depends on the excitation of the red, green and blue
phosphorus.
---- 4marks
12. a Matrix representation of all basic transformations.
Translation ---- 5marks
A translation moves all points in an object along the same straight-line path to new
positions. The path is represented by a vector, called the translation or shift vector.
4
Rotation ---- 6marks
A point p(X,Y) is to be rotated about the origin by angle theta to location p’(X',Y')
Scaling ---- 5marks
Scaling changes the size of an object and involves two scale factors, Sx and Sy for the x
and y- coordinates respectively.
Scales are about the origin
b Cohen-Sutherland line clipping algorithm
---- 4marks
Cohen Sutherland line clipping algorithm Cohen Sutherland line clipping algorithm
divides a two-dimensional space into 9 regions and then efficiently determines the lines
and portions of lines that are inside the given rectangular area.
Nine regions are created, eight "outside" regions and one "inside" region.
For a given line extreme point (x, y), we can quickly find its region's four-bit code. Four-
bit code can be computed by comparing x and y with four values (x_min, x_max, y_min
and y_max).
If x is less than x_min then bit number 1 is set.
If x is greater than x_max then bit number 2 is set.
If y is less than y_min then bit number 3 is set.
If y is greater than y_max then bit number 4 is set
5
---- 4marks
Liaong-barsky line clipping algorithm
Line clipping approach is given by the Liang and Barsky is faster then cohensutherland
line clipping. – 2 marks
6
-------6 marks
13. a Given a 3D object with coordinate points A(7, 4, 9), B(11,4,9), C(11,10,9) and D(7,10,9)
Perform the following transformations:
i. Increase the height of the object(z-axis) by thrice --- 5 marks
A’ [X’,Y’,Z’]=(7,12,9)
B’ [X’,Y’,Z’]=(11,12,9)
C’ [X’,Y’,Z’]=(11,30,9)
D’ [X’,Y’,Z’]=(7,30,9)
7
ii. Rotate the object in anticlockwise direction along the y-axis by an angle of 90◦
-- 6 marks
X’=ZSINO+XCOSO ; Y’=Y; Z’=ZCOSO+XSINO
A’ [X’,Y’,Z’]=[9SIN90+7COS90,4,9COS90+7SIN90]=[9,4,7]
B’ [X’,Y’,Z’]=(9,4,11)
C’ [X’,Y’,Z’]=(9,10,11)
D’ [X’,Y’,Z’]=(9,10,7)
iii. Perform reflection w.r.t yz plane. – 5 marks
A’ [X’,Y’,Z’]=(-7,4,9)
B’ [X’,Y’,Z’]=(-11,4,9)
C’ [X’,Y’,Z’]=(-11,10,9)
D’ [X’,Y’,Z’]=(-7,10,9)
b Color Gamut: ---2marks
The color gamut describes a range of colors within the spectrum of colors, or
a color space, that can be reproduced on an output device. This helps quantify the color
capabilities of a device.
---5marks
RGB: The RGB colour model is the most common colour model used in Digital image
processing and openCV. The colour image consists of 3 channels. One channel each for
one colour. Red, Green and Blue are the main colour components of this model. All other
colours are produced by the proportional ratio of these three colours only. 0 represents
the black and as the value increases the colour intensity increases.
---5marks
CMYK: CMYK colour model is widely used in printers. It stands for Cyan, Magenta,
Yellow and Black (key). It is a subtractive colour model. 0 represents the primary
colour and 1 represents the lightest colour. In this model, point (1, 1, 1) represents
black, and (0,0,0) represents white. It is a subtractive model thus the value is subtracted
from 1 to vary from least intense to a most intense colour value.
1-RGB = CMY
Cyan is negative of Red.
Magenta is negative of Green.
Yellow is negative of Blue.
---4marks
HSV: The image consists of three channels. Hue, Saturation and Value are three
channels. This colour model does not use primary colours directly. It uses colour in the
way humans perceive them.Hue is a colour component. Since the cone represents the
HSV model, the hue represents different colours in different angle ranges. Saturation
describes the percentage of the colour.
HSV model is used in histogram equalization and converting grayscale images to RGB
colour images.
14. a.i. File formats used for storing images ANY 2* 3=6 MARKS
An image file format is a file format for a digital image. There are many formats that can
be used, such as JPEG, PNG, and GIF,BMP,TIFF,WMF,AI and DIB The data stored in
8
an image file format may be compressed or uncompressed. If the data is compressed, it
may be done so using lossy compression or lossless compression
JPEG
JPEG (Joint Photographic Experts Group) is a lossy compression method; The
JPEG filename extension is JPG or JPEG. Nearly every digital camera can save images
in the JPEG format, which supports eight-bit grayscale images and 24-bit color images
(eight bits each for red, green, and blue). JPEG applies lossy compression to images,
which can result in a significant reduction of the file size.
GIF
The GIF (Graphics Interchange Format) is in normal use limited to an 8-bit palette, or
256 colors (while 24-bit color depth is technically possible). GIF is most suitable for
storing graphics with few colors, such as simple diagrams, shapes, logos, and cartoon
style images.
PNG
The PNG (Portable Network Graphics) file format.Compared to JPEG, PNG excels when
the image has large, uniformly colored areas.PNG provides a patent-free replacement for
GIF (though GIF is itself now patent-free) and can also replace many common uses of
TIFF.
a.ii JPEG Compression
JPEG stands for Joint Photographic Experts Group and is a lossy compression algorithm
that results in significantly smaller file sizes with little to no perceptible impact on
picture quality and resolution.
Steps -- 4 marks
-- 6 marks
Color Space Conversion
JPEG must first change the picture’s color space from RGB to YCbCr.
YCbCr consists of 3 different channels: Y is the luminance channel containing
brightness information, and Cb and Cr are chrominance blue and chrominance red
channels containing color information. In this color space, JPEG can make
changes to the chrominance channel to change the image’s color information
without affecting the brightness information that is located in the luminance
channel.
Downsampling
After we separate the color information from the brightness information, JPEG
downsamples the chrominance channels to a quarter of their original size. Each
9
block of 4 pixels is averaged into a single color value for all 4 pixels. As a result,
some information is lost, and the size of the picture is halved, but since the human
eye is not very sensitive to color, the changes are not easily distinguishable.
Division Into 8×8 Pixel Blocks
After downsampling, the pixel data of each channel is divided into 8×8 blocks of 64
pixels. From now on, the algorithm processes each block of pixels independently.
DCT (Discrete Cosine Transform)
Using DCT, for each channel, each block of 64 pixels can be reconstructed by
multiplying a constant set of base images by their corresponding weight values and then
summing them up together.
Quantization
The human eye is not very good at perceiving high-frequency elements in an image. In
this step, JPEG removes some of this high-frequency information without affecting the
perceived quality of the image.
Entropy Encoding
RLE and Huffman Coding are lossless compression algorithms that reduce the space
needed to store information without removing any data.
After zig-zag scanning, we get a list of integer values, and after running RLE on the list,
we get each number and how many times they’re repeated.
Finally, JPEG runs Huffman coding on the result, and the values that have more
frequency (like the zeroes) are represented with fewer bits than less frequent values.
b.i Various interaction technologies -- 6 marks
Input devices and technologies: keyboard, mouse, scanner, tablet, sensors, audio
microphone, touch screen, virtual reality devices
Output devices and technologies: monitor, LCD screen, projector, touch screen, printer
Storage and processing devices and technologies:
Storage – CD-ROM, Hard disk, DVD
Transmission-LAN, WAN, Internet telephony
Processing: hardware for digitization, hardware and software for processing audio, video,
graphics and animation
b.ii Audio file formats:
An audio file format is a file format for storing digital audio data on a computer system.
There are three major groups of audio file formats: --- 1marks
Uncompressed audio formats,
WAV, AIFF, PCM
Formats with lossless compression
FLAC, WavPack (filename extension .wv), TTA, ATRAC Advanced
Lossless, ALAC (filename extension .m4a), MPEG-4 SLS, MPEG-4 ALS, MPEG-4
DST
Formats with lossy compression
Opus, MP3, Vorbis, Musepack, AAC, ATRAC and Windows Media Audio Lossy
(WMA lossy)
Any three formats ---- 3 x 3 = 9 marks
15. a 1. Frame based Animation -- 4 marks
It is a typical and older and easiest way to animate an object in Flash.
In this type of animation, different parts of an image are placed separately on each
keyframe and when the frames are viewed, it generates an illusion of movement on
rapidly incrementing each keyframe.
10
It also increases the file size because Flash needs to store the contents for each keyframe.
Example: Frame-by-Frame animation can be used to move a car from one place to
another.
Steps for creating a frame-by-frame animation -- 4 marks
Step 1: Open a new Flash document to work.
Step 2: Insert a blank keyframe for each frame and add the desired animation
Step 3: Insert an object or picture for each state of animation on different keyframes.
Step 4: Now, press Enter or Return key to play the animation
2. Tween based animation -- 4 marks
In motion tweening, an object moves from one place to another within a timeline. It is
done by selecting its starting frame and ending frame that depicts its starting and
ending position. When viewed, it generates an illusion of motion by moving an object
from one place to another. It also allows us to move an object along a path, rotate or
change its attributes such as color, size, etc., during tweening.
Example : This tweening can be used to add animate a character with emotion or
expression or body movements like running or walking.
Steps for creating a Tween animation -- 4 marks
Step 1: Open a new Flash document.
Step 2: Insert a symbol to a layer from your library to the stage.
Step 3: Place the symbol in the upper-right corner of the stage from where the motion
will start and right-click the symbol and select Create Motion Tween from the
contextual menu.
Step 4: A layer is converted to a tween layer that appears on the Timeline. To create
animation, move the play head to different positions along the tween span and alter
changes on the symbol’s appearance or position.
Step 5: Drag the play head to a new frame and then reposition the symbol again. You
can resize, change color, rotate the symbol also.
Step 6: A new keyframe has been created automatically at this frame along with the
changes made. Drag the play head to another frame and move the symbol to another
position, reposition your symbol on every keyframe you have inserted.
Step 7: A motion path is created on the stage to display the path of animation the
symbol will take.
Step 8: play the animation
b MPEG video compression
-- 2 marks
-- 4 marks
11
MPEG Encoder – Operation with diagram -- 8 marks
Presentation/Display Order and Decoding Order ( I- frame & P-Frame) -- 2marks
12
Presentation/Display Order and Decoding Order ( I- frame,P-Frame & B-Frame)
The encoder and decoder need to maintain two “orders” or “queues” in their
memory – one to place the frames in the correct display order and another to place
the frames in the other required to encode & decode them.
13