MC 5
MC 5
IMAGES
Photographs
Paintings
Drawings
Symbols
Corporate logos
Flags
Maps
Diagrams
Graphs
Image Concepts
• An image is a function of intensity values over a 2D plane I(r,s)
• Sample function at discrete intervals to represent an image in
digital form
◦ matrix of intensity values for each color plane
◦ intensity typically represented with 8 bits
• Sample points are called pixels
• Quantization refers to the number of bits per pixel
Image Concepts
• Pixels
Image Presentation
• Bitmap
◦ The two-dimensional array of pixel values that represents the
graphics/image data
•
• Image resolution
◦ The number of pixels in a digital image (width x height)
Image Concepts
• Pixels
Image Concepts
• Image (1-bit Quantization)
1 1 0 0
1 1 0 0
1 1 0 0
1 1 0 0
1 1 0 0
1 1 0 0
1 1 1 1
1 1 1 1
Image Presentation
• Frame buffer:
◦ Hardware used to store bitmap.
• A graphics card is used for this purpose.
◦ but if not enough video card memory is available then the data has to be
shifted around in RAM for display.
• File size = ?
◦ width x height x #ofBitsPerPixel
Image Concepts
Monochrome Images
• Each pixel is stored as a single bit (0 or 1)
◦ Also referred to as binary image.
◦ Such an image is also called a 1-bit monochrome
image since it contains no color.
◦ For pictures containing simple graphics / text
• p(x,y) = 0 or 1
• A 640 x 480 monochrome image requires 37.5
Kbytes
640 x 480 x 1 = 307200 bits
307200 / 8 = 38400 bytes
38400 / 1024 = 37.5 Kbytes
Image Concepts
• Image (3-bit Quantization)
Image Concepts
3-Bit Images
• Each pixel is stored with 3 bit color information
◦ p(x,y) = 000, 001, …., 111
• Pixels
Image Concepts
Color Images
three color planes each with 8 bits (RGB, CMY, YIQ, etc.)
• Each pixel is usually stored with 8, 16, or 24
bit color information.
◦ Information for each color R, G, and B
Color Images
• What would be the file size of a 4 bit image with a resolution of 1024x768?
File size calculation
◦ File size= 1024 x 768 x 4/8
◦ File size = 393,216 bytes = 384 Kbytes
Image n
Image File Formats
GIF – Graphic Interchange Format
• The Header is 6bytes in size and is used only to identify the file as type GIF. The Logical Screen
Descriptor, which may be separate from the actual file header, may be thought of as a second header.
You may store the Logical Screen Descriptor information in the same structure as the Header:
• typedef struct _GifHeader
• {
• // Header
• BYTE Signature[3]; /* Header Signature (always "GIF") */
• BYTE Version[3]; /* GIF format version("87a" or "89a") */
• // Logical Screen Descriptor
• WORD ScreenWidth; /* Width of Display Screen in Pixels */
• WORD ScreenHeight; /* Height of Display Screen in Pixels */
• BYTE Packed; /* Screen and Color Map Information */
• BYTE BackgroundColor; /* Background Color Index */
• BYTE AspectRatio; /* Pixel Aspect Ratio */
• }
• GIFHEAD;
Image File Formats
• GIF – Graphic Interchange Format
• Strength:
◦ It is lossless for 8-bit images.
◦ best suited for images with few distinctive colors (e.g., graphics or drawing)
◦ Well suited for image sequences (can have multiple images in a file)
◦ Animated GIFs are easy to make by using GIF construction packages.
• Weakness:
◦ Not suitable for 24-bit images.
◦ When compressing such images, much of color information is lost.
◦ Compression ratios are low.
Image File Formats
• PNG – Portable Network Graphics is of type bitmap, it is platform
independent and compression is ZIP method.
• TIFF – Tagged Image File Format is of type bitmap, it allows various types of
compressions, and different depths, popular in many industrial
applications.
◦ It offers, binary levels, gray levels, palettes, RGB and CMKY colors.
◦ Support of broad range of compression methods including run-length
encoding, LZW compression and various encoding methods including Huffman
encoding.
Image File Formats
• Postscript is an important language for typesetting, and many high-end
printers have a Postscript interpreter built into them.
• Postscript is a vector-based picture language, rather than pixel-based: page
element definitions are essentially in terms of vectors.
◦ Postscript includes text as well as vector/structured graphics.
◦ Several popular graphics programs, such as Illustrator and FreeHand, use
PostScript.
◦ Postscript language itself does not provide compression; (stored as ASCII).
• Another text + figures language.
◦ Adobe Systems Inc. includes LZW compression in its Portable Document
Format (PDF) file format.
Image File Formats
• PostScript – It is of type vector and is a page description language. Used to
describe images in a device independent manner.
• Level 1 PostScript-Concept of scalable fonts
• Level 2 PostScript- Filling of patterns and regions. Efficient text processing
and complete color concept for both device dependent and device
independent resolution.
• Level 3 Postscript- Modern digital document processing
• AutoCAD DXF – It is of type vector and is specific for CAD applications.
Image Dithering
• Dithering is used in computer graphics to create the illusion of color depth in
images on systems with a limited color palette.
◦ It is an attempt by a computer program to approximate a color from a mixture of
other colors when the required color is not available.
◦ In a dithered image, colors that are not available in the palette are approximated by a
diffusion of colored pixels from within the available palette.
• For example, dithering occurs when a color is specified for a Web page that a
browser on a particular operating system can't support.
• Dithering also occurs when a display monitor attempts to display images specified
with more colors than the monitor is equipped to handle.
Image Dithering
Example
• Dithering is a retro way of reducing the colors in
an image for use on old hardware or in print. It
removes colors, and strategically place dots to
emulate the missing shades.