Unit 2
Unit 2
SYLLABUS
UNIT II:
Text: Introduction, Types of Text, Unicode Standard, Font, Insertion of Text, Text
compression, File Formats.
Image: Introduction, Image Types, Seeing colors, color models, Basic steps for Image
processing, Scanner, Digital camera, Interface Standards, Image processing software, File
formats, Image output on monitor, Image output on printer.
UNIT – II
Text: Introduction
In multimedia presentations, text can be combined with other media in a powerful way to
present information and express moods. Text can be of various types:
Plaintext, consisting of fixed sized characters having essentially the same type of
appearance.
Formatted text, where appearance can be changed using font parameters
Hypertext, which can serve to link different electronic documents and enable the user
to jump from one to the other in a non-linear way.
Internally text is represented via binary codes as per the ASCII table. The ASCII table is
however quite limited in its scope and a new standard has been developed to eventually
replace the ASCII standard. This standard is called the Unicode standard and is capable of
representing international characters from various languages throughout the world.
We also generate text automatically from a scanned version of a paper document or image
using Optical Character Recognition (OCR) software.
TYPES OF TEXT
There are three types of text that can be used to produce pages of a document:
Unformatted text
Formatted text
Hypertext
Unformatted Text:
Also known as plaintext, this comprise of fixed sized characters from a limited character
set. The character set is called ASCIItable which is short for American Standard Code for
Information Interchange and is one of the most widely used character sets. It basically
consists of a table where each character is represented by a unique 7-bit binary code.
The characters include a to z, A to Z, 0 to 9, and other punctuation characters like
parenthesis, ampersand, single and double quotes, mathematical operators, etc. All the
characters are of the same height. In addition, the ASCII character set also includes a
number of control characters. These include BS (backspace), LF (linefeed), CR (carriage
return), SP (space), DEL (delete), ESC (escape), FF (form feed) and others.
Formatted Text:
Formatted text are those where apart from the actual alphanumeric characters,
other control characters are used to change the appearance of the characters, e.g.
bold, underline, italics, varying shapes, sizes, and colors etc., Most text processing
software use such formatting options to change text appearance. It is also extensively
used in the publishing sector for the preparation of papers, books, magazines, journals,
and so on.
Hypertext:
The term Hypertext is used to mean certain extra capabilities imparted to normal or
standard text. Like normal text, a hypertext document can be used to reconstruct
knowledge through sequential reading but additionally it can be used to link multiple
documents in such a way that the user can navigate non-sequentially from one document
to the other for crossreferences. These links are called hyperlinks. Microsoft Home Page
The underlined text string on which the user clicks the mouse is called an anchor
and the document which opens as a result of clicking is called the target document. On the
web target documents are specified by a specific nomenclature called Web site address
technically known as Uniform Resource Locators or URL.
Node or Anchor:
The anchor is the actual visual element (text) which provides an entry point to another
document. In most cases the appearance of the text is changed from the surrounding text to
designate a hypertext, e.g. by default it is colored blue with an underline. Moreover the mouse
pointer changes to a finger icon when placed over a hypertext. The user usually clicks over the
hypertext in order to activate it and open a new document in the document viewer. In some
cases instead of text an anchor can be an image, a video or some other non-textual element
(hypermedia).
Pointer or Link
These provide connection to other information units known as target documents. A link
has to be defined at the time of creating the hyperlink, so that when the user clicks on an
anchor the appropriate target document can be fetched and displayed. Usually some
information about the target document should be available to the user before clicking on the
anchor. If the destination is a text document, a short description of the content can be
represented.
UNICODE STANDARD:
The Unicode standard is a new universal character coding scheme for written
characters and text. It defines a consistent way of encoding multilingual text which enables
textual data to be exchanged universally. The Unicode standard goes far beyond ASCII‘s limited
capability by providing the capacity of encoding more than 1 million characters. The Unicode
standard draws a distinction between characters, which are the smallest component of written
language, and glyphs, which represent the shapes, the characters can have when displayed.
Some of the languages and their corresponding codes are: Latin (00), Greek (03),
Arabic (06), Devanagari/Bengali (09), Oriya/Tamil (0B), etc. Several methods have been
suggested to implement Unicode based on variations in storage space and compatibility. The
mapping methods are called Unicode Transformation Formats (UTF) and Universal Character
Set (UCS). Some of the major mapping methods are:
a) UCS-4,UTF-32
Uses 32-bit for each character. The simplest scheme as it consists of fixed length
encoding, how it is not efficient with regard to storage space and memory usage, and therefore
rarely used. Initially the UCS-4 was proposed with a possible address range of 0 to FFFFFFFFFF,
but Unicode requires only upto 10FFFF.
b) UTF-16
A 16-bit encoding format. In its native format it can encode numbers upto FFFF, i.e, as
xxxxxxx xxxxxxx. For codings beyond this, the original number is expressed as a
combination of two 16-bit numbers.
c) UTF-8
The bits of a Unicode character is divided into a series of 8-bit numbers. The output
code against various ranges of input codes are given in Table 4.1
Code range Input code Output code
000000-00007F Xxxxxxx 0xxxxxxx
000080-0007FF xxx xxxxxxxxx 110xxxx 10xxxxxxx
FONT
FONT: Insertion of Text
Text can be inserted in a document using a variety of methods. These are:
1) Using a keyboard
The most common process of inserting text into a digital document is by typing
the text using an input device like the keyboard. Usually a text editing software, like
Microsoft Word, is used to control the appearance of text which allows the user to
manipulate variables like the font, size, style, color, etc.,
Copying and Pasting
Another way of inserting text into a document is by copying text from a
preexisting digital document. The existing document is opened using the corresponding
text processing program and portions of the text may be selected by using the
keyboard or mouse. Using the Copy command the selected text is copied to the
clipboard. By choosing the Paste command, whereupon the text is copied from the
clipboard into the target document.
2) Using an OCR Software
A third way of inserting text into a digital document is by scanning it from a paper
document. Text in a paper document including books, newspapers, magazines,
letterheads, etc. can be converted into the electronic form using a device called the
scanner. The electronic representation of the paper document can then be saved as a file
on the hard disk of the computer. To be able to edit the text, it needs to be converted from
the image format into the editable text format using software called an Optical Character
Recognition (OCR). The OCR software traditionally works by a method called pattern
matching. Recent research on OCR is based on another technology called feature
extraction.
TEXT COMPRESSION:
Large text documents covering a number of pages may take a lot of disk space.
We can apply compression algorithms to reduce the size of the text file during storage. A
reverse algorithm must be applied to decompress the file before its contents can be displayed
on screen.
There are two types of compression methods that are applied to text as explained:
a. Huffman Coding:
This type of coding is intended for applications in which the text to be
compressed has known characteristics in terms of the characters used and their relative
frequencies of occurrences. An optimum set of variable-length code words is derived
such that the shortest code word is used to represent the most frequently occurring
characters. This approach is called the Huffman coding method.
b. Lempel-Ziv (LZ) Coding
In the second approach followed by the Lempel-Zir (LZ) method, instead of
using a single character as a basis of the coding operation, a string of characters is used.
For example, a table containing all the possible words that occur in a text document, is
held by both the encoder and decoder.
c. Lempel-Ziv-Welsh (LZW) Coding
Most word processing packages have a dictionary associated with them which is
used for both spell checking and compression of text. The variation of the above
algorithm called Lempel-Ziv-Welsh (LZW) method allows the dictionary to be built up
dynamically by the encoder and decoder for the document under processing.
FILE FORMATS:
The following text formats are usually used for textual documents.
TXT (Text)
Unformatted text document created by an editor like Notepad on Windows
platform. This documents can be used to transfer textual information between different
platforms like Windows, DOS, and UNIX,
DOC (Document)
Developed by Microsoft as a native format for storing documents created by the
MS Word package. Contains a rich set of formatting capabilities.
RTF (Rich Text Format)
Developed by Microsoft in 1987 for cross platform document exchanges. It is
the default format for Mac OS X‘s default editor TextEdit. RTF control codes are human
readable, similar to HTML code.
DF (Portable Document Format)
Developed by Adobe Systems for cross platform exchange of documents. In
addition to text the format also supports images and graphics. PDF is an open standard
and anyone may write programs that can read and write PDFs without any associated
royalty charges.
PostScript (PS)
Postscript is a page description language used mainly for desktop publishing. A
page description language is a high-level language that can describe the contents of a
page such that it can be accurately displayed on output devices usually a printer. A
PostScript interpreter inside the printer converted the vercors backi into the raster dots
to be printed. This allows arbitrary scaling, rotating and other transformations.
IMAGES: INTRODUCTION
The pictures that we see in our everyday life can be broadly classified into two
groups:
Images
Graphics
Images can either be pure black and white, or grayscale having a number of grey shades, or
color containing a number of color shades. Color is a sensation that light of different
frequencies generates on our eyes, the higher frequencies producing the blue end and the
lower frequencies producing the red end of the visible spectrum. White light is a combination
of all the colors of the spectrum. To recognize and communicate color information we need to
have color models. To recognize and communicate color information we need to have color
models. The two most well known color models are the RGB model used for colored lights like
images on a monitor screen, and the CMYK model used for colored inks like images printed on
paper. One of the most well known device independent color model is the HSB Model where
the primaries are hue, saturation and brightness.
The total range of colors in a color model is known is its gamut. The input stage deals with the
issues of converting hardcopy paper images into electronic versions. This is usually done via a
device called the scanner. While scanners are used to digital documents, another device called
the digital camera can convert a real world scene into a digital image. Digital camera can also
contain a number of these electronic sensors which are known as Charge-Couple Devices
(CCD) and essentially operate on the same principle as the scanner. This is the editing stage
and involves operations like selecting, copying, scaling, rotating, trimming, changing the
brightness, contrast color tones, etc. of an image to transform it as per the requirements of the
application.The output stage involves saving the transformed image in a file format which can
be displayed on the monitor screen or printed on a printer. To save the image, it is frequently
compressed by a compression algorithm is ued the final image can be saved into a variety of
file formats.
IMAGE TYPES
Images that we see in our everyday lives can be categorized into various types.
1. Hard Copy vs. Soft Copy
The typical images that we usually come across are the pictures that have been
printed on paper or some other kinds of surfaces like plastic, cloth, wood, etc. These are
also called hard copy images because they have been printed on solid surfaces. Such
images have been transformed from hard copy images or real objects into the electronic
form using specialized procedures and are referred to as soft copy images.
SEEING COLOR
The Phenomenon of seeing color is dependent on a triad of factors: the nature of light,
the interaction of light and matter, and the physiology of human version. Light is a form of
energy known as electromagnetic radiation. It consists of a large number of waves with
varying frequencies and wavelengths. Out of the total electromagnetic spectrum a small range
of waves cause sensations of light in our eyes. This is called the visible spectrum of waves.
The second part of the color triad is human vision. The retina is the light-sensitive part of
the eye and its surface is composed of photoreceptors or nerve endings.
The third factor is the interaction of light with matter. Whenever light waves strike an
object, part of the light energy gets absorbed and /or transmitted, while the remaining part
gets reflected back to our eyes.
Refraction Index(RI) is the ratio of the speed of light in a vaccum. A beam of transmitted
light changes direction according to the difference in refractive index and also the angle at
which it strikes the transparent object. This is called refraction. If light is only partly
transmitted by the object, the object is translucent.
COLOR MODELS
Researchers have found out that most of the colors that we see around us can be derived from
mixing a few elementary colors. These elementary colors are known as primary colors. Primary
colors mixed in varying proportions produce other colors called composite colors. Two primary
colors mixed in equal proportions produce a secondary color. The primary colors along with
the total range of composite colors they can produce constitute a color model. a)RGB Model
The RGB color model is used to describe behavior of colored lights like those
emitted from a TV screen or a computer monitor. This model has three primary colors:
red, green, blue, in short RGB.
Proportions of colors are determined by the beam strength. An electron beam
having the maximum intensity falling on a phosphor dot creates 100% of the
corresponding color.50% of the color results from a beam having the half the peak
strength. All three primary colors at full intensities combine together to produce white,
i.e. their brightness values are added up. Because of this the RGB model is called an
additive model. Lower intensity values produce shades of grey. A color present at 100%
of its intensity is called saturated, otherwise the color is said to be unsaturated.
b) CMYK Model
The RGB model is only valid for describing behavior of colored lights. This new
model is named CMYK model and is used to specify printed colors. The primary colors
of this model are cyan, magenta and yellow. These colors when mixed together in equal
proportions produce black, due to which the model is known as a subtractive model.
Mixing cyan and magenta in equal proportions produce blue, magenta and
yellow produce red, and yellow and cyan produce green. Thus, the secondary colors of
the CMYK model are the same as the primary colors of the RGB model and vice versa.
These two models are thus, known as complimentary models.
c) Device Dependency and Gamut
It is to be noted that both the RGB and the CMYK models do not have universal
or absolute color values. But different devices will give rise to slightly different sets of
colors. For this reason both the RGB and the CMYK models are known as device
dependent color models.
Another issue of concern here is the total range of colors supported by each
color model. This is known as the gamut of the model.
Image processing is the name given to the entire process involved with the input, editing
and output of images from a system. There are three basic steps:
a. Input
Image input is the first stage of image processing. It is concerned with getting
natural images into a computer system for subsequent work. Essentially it deals with
the conversion of analog images into digital forms using two devices. The first is the
scanner which can convert a printed image or document into the digital form. The
second is the digital camera which digitizes real-world images, similar to how a
conventional camera works.
b. Editing
After the images have been digitized and stored as files on the hard disk of a
computer, they are changed or manipulated to make them more suitable for specific
requirements. This step is called editing. Before the actual editing process can begin, and
important step called color calibration needs to be performed to ensure that the image looks
consistent when viewed on multiple monitors.
c. Output
Image output is the last stage in image processing concerned with displaying the
edited image to the user. The image can either be displayed in a stand-alone manner or as
part of some application like a presentation or web-page.
SCANNER
For images, digitization involves physical devices like the scanner or digital
camera. The scanner is a device used to convert analog images into the digital form. The most
common type of scanner for the office environment is called the flatbed scanner. The
traditional way of attaching a scanner to the computer is through an interface cable connected
to the parallel port of the PC.
Construction and Working principle:
To start a scanning operation, the paper document ot be scanned is placed face
down on the glass panel of the scanner, and the scanner is activated using a software from the
host computer. The light on getting reflected by the paper image is made to fall on a grid of
electronic sensors, by an arrangement of mirrors and lenses. The electronic sensors are called
Charge Coupled Devices (CCD) and are basically converters of the light energy into voltage
pulses. After a complete scan, the image is converted from a continuous entity into a discrete
form represented by a series of voltage pulses. This process is called sampling.
The voltage signals are temporarily stored in a buffer inside the scanner. The next step
called quantization involves representing the voltage pulses as binary numbers and carried out
by an ADC inside the scanner in conjuction with a software bundled with the scanner called the
scanning software.
Since each number has been derived from the intensity of the incident light, these
essentially represent brightness values at different points of the image and are known as
pixels.
Scanner Types:
Scanners can be of various types each designed for specific purposes.
a. Flatbed scanners:
The flatbed scanner is the most common type in office environments and has
been described above. It looks like a photocopying machine with a glass panel on which
the document to be scanned is placed face down. Below the glass panel is a moving
head with a source of white light usually xenon lamps.
b. Drum Scanners:
Drum Scanner is used to obtain good quality scans for professional purposes
and generally provides a better performance than flatbed scanners. It consists of a
cylindrical drum made out of a highly translucent plastic like material. The fluid can
either be oilbased or alcohol-based. For the sensing element, drum scanners use a
Photo-Multiplier Tube (PMT) instead of a CCD. An amplifier gain of the order of 10 8
can be achieved in multipliers containing about 14 dynode, which can provide
measurable pulses from even single photons.
c. Bar-code Scanners:
A barcode scanner is designed specifically to read barcodes printed on various
surfaces. A barcode is a machine-readable representation of information in a visual format.
Nowadays they come in other forms like dots and concentric circles. Barcodes relieve the
operator of typing strings in a computer, the encoded information is directly read by the
scanner. A LASER barcode scanner is more expensive that a LED one but is capable of
scanning barcodes at a distance of about 25cm. Most barcode scanners use the PS/2 port
for getting connected to the computer.
d. Color Scanning
Since the CCD elements are sensitive to the brightness of the light, the pixels
essentially store only the brightness information of the original image. This is also known as
luminance (or luma) information. To include the color or chrominance (or chroma)
information, there are three CCD elements for each pixel of image formed. White light
reflected off the paper document is split into the primary color components by a glass
prism and made to fall on the corresponding CCD sub-components.
e. Pixel Information:
To describe a color digital image, the pixels need to contain both the luma and the
chroma values, i.e. the complete RGB information of each color. To represent the orange
color we write: R=245 (96% of 255), G=102 (40% of 255), B=36 (14% of 255). This is called
a RGB triplet and notation for making it more compact, e.g. given below. These values are
also called RGB attributes of a pixel.
f. Scan quality:
The quality of a scanned image is determined mostly by its resolution and color
depth. The scanner resolution pertains to the resolution of the CCD elements inside a
scanner measured in dots per inch (dpi). Scanner resolution can be classified into two
categories; the optical resolution refers to the actual number of sensor elements per inch
on the scan head. Scanners however are often rated with resolution values higher than that
of the optical resolution e.g. 5400, 7200 or 9600dpi. These resolutions are called
interpolated resolutions and basically involve an interpolation process for generating new
pixel values. g. Scanning Software:
To scan an image, the user needs a scanning software to be installed on the
computer as in (fig) given below. The software lets the user interact with the scanner and
set parameters like bit depth and resolution. A typical scanning software should allow the
user to do the following:
i. Set the bit depth of the image file, which in turn determines the total number
of colors.
ii. Set the output path of the scanned image.
iii. Set the file type of the scanned image. Most scanners nowadays suppor the
standard file types like DMP, JPG, TIFF, etc.
iv. Adjust the brightness and contrast parameters usually by dragging sliders.
v. Change the size of the image by specifying a scale factor.
vi. Adjust the color of the scanned image by manipulating the amounts of red,
green and blue primaries.
vii. Adjust the resolution value.
The final‘ button instructs the scanner to save the updated pixel values in a file
whose type and location have been previously specified.
DIGITAL CAMERA
Construction and working principle:
Apart from the scanner used to digitize paper documents and film, another device
used to digitize real world images is the digital camera. Unlike a scanner a digital camera is
usually not attached to the computer via a cable. The camera has its own storage facility inside
it usually in the form of a floppy drive, which can save the image created into a floppy disc. So
instead they are compressed to reduce their file sizes and stored usually in the JPEG format.
This is a lossy compression technique and results in slight loss in image quality.
Most of the digital cameras have an LCD screen at eh back, which serve now
important purposes: first it can be used as a viewfinder for composition and adjustment;
secondly it can be used for viewing the images stored inside the camera. The recent innovation
of built-in microphones provides for sound annotation, in standard WAV format. After
recording, this sound can be sent to an external device for playback on headphones using an
ear socket.
Storage and Software utility
Digital cameras also have a software utility resident in a ROM chip inside it which
allow the user to toggle between the CAMERA mode and PLAY mode. In the PLAY mode
the user is presented with a menu structure having some fo the functionalities like:
displaying all the images on the floppy , selecting a particular image, deleting selected
images, writeprotecting the important image for deletion, setting the date and time,
displaying how much of the floppy disk space is free and even allowing a floppy to be
formatted in the drive.
INTERFACE STANDARDS
Interface standards determine how data from acquisition devices like scanners
and digital cameras flow to the computer in an efficient way. Refer fig.5.15. Two main interface
standards exists: TWAIN and ISIS.
i. TWAIN:
TWAIN is a very important standard in image acquisition, developed by
HewlettPackard, Kodak, Aldus, Logitech and Caere which specifies how image acquisition
devices such as scanners, digital cameras and other devices transfer data to software
applications. It is basically an image capture API for Microsoft Windows and Apple
Macintosh platforms. The standard was first released in 1992.
TWAIN is a software protocol which regulates the flow of information between
software applications and imaging devices like scanners. The standard is managed by the
TWAIN Working Group which is a non-profit organization with representative from leading
imaging vendors. The goals of the working group included: multiple platform support,
support for different types of devices like flatbed scanners, handheld scanners, image
capture boards, digital cameras, etc., provide a well-defined standard that gains support
and acceptance from leading hardware and software developers.
ii. Image and Scanner Interface Specification (ISIS)
The second important standard for document scanner is the Image and Scanner
Interface Specification (ISIS). It was developed by Pixel Translations and they retain control
over its development and licensing. ISIS has a wider set of features than TWAIN and
typically uses the SCSI-2 interface while TWAIN mostly uses the USB interface. Currently
ISIS compatible drivers are available for more than 250 scanner models most of them
certified by Pixel Translations.
FILE FORMATS
Images may be stored in a variety of file formats. Each file format is characterized
by a specific compression type and color depth. The choice of file formats would depend on
the final image quality required and the import capabilities of the authoring system. The most
popular file formats are:
1) BMP (Bitmap)
BMP is a standard Windows compatible computer. BMP formats supports RGB,
Indexed Color, Grey scale and Bitmap color modes, and does not support alpha channels.
2) JPEG (Joint Photographers Expert Group)
Joint Photographers Expert Group (JPEG) format is commonly used to display
photographs and other continuous-tone images in hypertext markup language (HTML)
documents over the World Wide Web and other online services.
3) GIF (Graphics Interchange Format)
Graphics Interchange Format (GIF) is the file format commonly used to display
indexed color graphics and images in hypertext markup language (HTML) document
over the World Wide Web and other online services.
4) TIFF (Tagged Image File Format)
Tagged Image File Format (TIFF) designed by Aldus Corporation and Microsoft in
1987, is used to exchange files between applications and computer platforms. TIFF is a
flexible bitmap image format supported by virtually all paint, image-editing and page
layout applications.
5) PNG (Portable Network Graphics)
Developed as a patent-free alternative to GIF, Portable Network Graphics (PNG)
format is used for lossless compression and for display of images on the World Wide Web.
6) PICT (Picture)
PICT format is widely used among Mac OS graphics and page-layout applications as
an intermediatary file format for transferring images between applications. PICT format is
especially effective at compression images with large areas of solid color.
7) TGA (Targa)
Targa (TGA) format is designed for systems using the True vision video board and is
commonly supported by MS-DOS color applications. This format supports 24-bit RGB
images.
8) PSD (Photoshop Document)
Photoshop (PSD) format is a default file format used in the Adobe Photoshop
package and the only format supporting all available image modes.
IMAGE OUTPUT ON MONITOR
The image pixels are actually strings of binary numbers and therefore may be
referred to as logical pixels. When the images are displayed on the monitor however, the
logical pixels are directly mapped on to the phosphor dots of the monitor, which may be
referred to asphysical pixels.
Dependence on Monitor Resolution
Let us consider an image having dimensions 1 inch by 1 inch and a resolution of
72ppi. Thus, the image is made up of 72 logical pixels horizontally and 72 logical pixels
vertically. The monitor resolution in this case is equal to the image resolution.
Let us consider an image be rescanned at a high resolution of 144ppi. Thus, the
image is made up of 144 logical pixels. The monitor resolution is however unchanged at
72dpi. The monitor resolution in this case is less to the image resolution.
On the other hand if the image resolution decreases to 30ppi, internally 1 inch of
the image will consist of 30 logical pixels. The monitor resolution in this case is more than
the image resolution and makes the image look smaller.
Dependence on Monitor Size
Let us consider a 15‖ monitor which displays 640 pixels horizontally and 480 pixels
vertically. An image with pixel dimensions of 640X480 would fill up the entire screen. If the
viewing mode of the 20‖ Monitor is increased to 800 by 600 then the image will occupy only a
portion of the screen as the available number of pixels is more than that required for displaying
the image.