Multimedia apllication imag, video formats

86
Multimedia Applications for BCA Pardeep Sharma pardeepsharma727@gmail .com BGSBU, Rajouri

description

Multimedia Applications: Image Data types Color Model Images File Formats Frames

Transcript of Multimedia apllication imag, video formats

Page 1: Multimedia apllication imag, video formats

Multimedia Applications for BCA

Pardeep [email protected], Rajouri

Page 2: Multimedia apllication imag, video formats

Contents

• Image Data Types• Popular File Formats (JPEG, PNG,GIF)• Color Models

Page 3: Multimedia apllication imag, video formats

Image Data Types

Page 4: Multimedia apllication imag, video formats

1-Bit Image

• Each pixel is stored as a single bit(0 or 1).• A 640 * 480 monochrome image requires

38.4kb of storage.• Such Images are also referred as binary

images.• Simplest form of Image.

Page 5: Multimedia apllication imag, video formats

Monochrome 1-bit Lena Image

Page 6: Multimedia apllication imag, video formats

8-bit Gray Image

• Each pixel is usually stored as byte(0-255).• The entire image can be thought of 2D array of

pixel value. We refer such array as bitmap.• Image resolution refer as the number of pixel in

digital image. Fairly high resolution for such image might be 1600 * 1200 where as low resolution be 640 * 480.

• A 640 * 480 gray image requires over 300kb of storage.

Page 7: Multimedia apllication imag, video formats

Bitplanes

Page 8: Multimedia apllication imag, video formats

Bitmap

Page 9: Multimedia apllication imag, video formats

8-bit Gray Image

Page 10: Multimedia apllication imag, video formats

8-bit Color Image

• One byte for each pixel.• Support 256 out of million possible colors.• A 640 * 480 gray image requires over 300kb of

storage(Same as 8 bit gray).• Requires color Look-up tables(LUT).

Page 11: Multimedia apllication imag, video formats

8-bit Color Image

Page 12: Multimedia apllication imag, video formats

Color Look-up Table

• The idea used in 8-bit color image is to store only index, or code value.

• If a pixel stores say value 25, the meaning is to go to row 25 in LUT.

• LUT is often called pallette.

Page 13: Multimedia apllication imag, video formats

Color Look-up Table

Page 14: Multimedia apllication imag, video formats

24-bit Color Image

• Each pixel is represent by three bytes(RGB).• Supports 256 * 256 * 256 possible colors

(16,777,216).• A 640 * 480 gray image requires over 921kb of

storage without any compression.• Most 24 bit images are 32 bit images, one extra

byte of data for each pixel is used to store for alpha value, representing special effect information.

Page 15: Multimedia apllication imag, video formats

24-bit Color Image

Page 16: Multimedia apllication imag, video formats

8-bit Color Image

Page 17: Multimedia apllication imag, video formats

24-bit Color Image

Page 18: Multimedia apllication imag, video formats

Popular File Format

• GIF• JPEG• PNG• TIFF• PS

Page 19: Multimedia apllication imag, video formats

GIF

• Graphic Interchange Format• GIF devised by UNISYS Corporation and

Compuserve, and initially for transmitting graphic images over telephone line through MODEM.

• GIF uses Lempel-ziv-Welch algorithm (Compression).

• GIF standard is limited to 8-bit(256) color image only.

• Support interlacing.

Page 20: Multimedia apllication imag, video formats

Interlacing

Page 21: Multimedia apllication imag, video formats

GIF Flavors

• GIF 87a -> Original version, Support multiple

image in a stream• GIF 89a -> Support animation delay, transparent

background and storage of application specific metadata.

Page 22: Multimedia apllication imag, video formats

GIF

Page 23: Multimedia apllication imag, video formats

GIF

Page 24: Multimedia apllication imag, video formats

Animation

Page 25: Multimedia apllication imag, video formats

JPEG

Page 26: Multimedia apllication imag, video formats

JPEG

• This standard was created by a working group of the international organization for standardization(ISO).

Page 27: Multimedia apllication imag, video formats

JPEG

• This standard was created by a working group of the international organization for standardization(ISO).

• The group is called Joint Photographic Expert Group.

Page 28: Multimedia apllication imag, video formats

JPEG

• This standard was created by a working group of the international organization for standardization(ISO).

• The group is called Joint Photographic Expert Group.

• Provide high range of compression(Lossy)

Page 29: Multimedia apllication imag, video formats

JPEG

• This standard was created by a working group of the international organization for standardization(ISO).

• The group is called Joint Photographic Expert Group.

• Provide high range of compression(Lossy)• Take advantage of limitation in the human

vision system to achieve high rate of compression.

Page 30: Multimedia apllication imag, video formats

PNG

• Portable Network Graphic.

Page 31: Multimedia apllication imag, video formats

PNG

• Portable Network Graphic.• Patent held by UNISYS and COMPUSERVE.

Page 32: Multimedia apllication imag, video formats

PNG

• Portable Network Graphic.• Patent held by UNISYS and COMPUSERVE.• LZW Compression method.

Page 33: Multimedia apllication imag, video formats

PNG

• Portable Network Graphic.• Patent held by UNISYS and COMPUSERVE.• LZW Compression method.• PNG files support upto 48 bit of color

information.

Page 34: Multimedia apllication imag, video formats

Color Models in Images

Page 35: Multimedia apllication imag, video formats

Color Models in Images

• RGB• CMY

Page 36: Multimedia apllication imag, video formats

RGB Color Model

• RGB color model is additive color model

Page 37: Multimedia apllication imag, video formats

RGB Color Model

• RGB color model is additive color model• Red, Green, Blue three colors are added

together in various ways to reproduces Many different colors.

Page 38: Multimedia apllication imag, video formats

RGB Color Model

• RGB color model is additive color model• Red, Green, Blue three colors are added

together in various ways to reproduces Many different colors.

• Each of three beams are called component of that color.

Page 39: Multimedia apllication imag, video formats

RGB Color Model

• RGB color model is additive color model• Red, Green, Blue three colors are added

together in various ways to reproduces Many different colors.

• Each of three beams are called component of that color.

• Zero intensity of each color gives darkest color(No Light, consider BLACK).

• Full intensity of each color gives white color.

Page 40: Multimedia apllication imag, video formats

RGB Color Model

Page 41: Multimedia apllication imag, video formats

RGB Color Model

Page 42: Multimedia apllication imag, video formats

RGB Color Model

Page 43: Multimedia apllication imag, video formats

CMY Color Model

• Stands for Cyan, Magenta, Yellow

Page 44: Multimedia apllication imag, video formats

CMY Color Model

• Stands for Cyan, Magenta, Yellow• CMY is subtractive color model used in

printing.

Page 45: Multimedia apllication imag, video formats

CMY Color Model

• Stands for Cyan, Magenta, Yellow• CMY is subtractive color model used in

printing.• A printed color that look red absorb other two

component G and B and reflect Red.

Page 46: Multimedia apllication imag, video formats

CMY Color Model

• Stands for Cyan, Magenta, Yellow• CMY is subtractive color model used in

printing.• A printed color that look red absorb other two

component G and B and reflect Red.• In CMY, Black arise from subtracting all the

light by laying down the link C=M=Y=1.

Page 47: Multimedia apllication imag, video formats

CMY Color Model

Page 48: Multimedia apllication imag, video formats

CMY Color Model

• Cyan Subtract Red.• Magenta subtract Green• Yellow subtract Blue.

Page 49: Multimedia apllication imag, video formats

CMYK

• CMYK are supposed to mix to black.• However, they mix to a muddy brown.• Truly black is cheaper than mixing color ink to

make black.• CMYK refer four inks used in some color

printing: Cyan, Magenta, Yellow and black.• This is called undercolor removal.

Page 50: Multimedia apllication imag, video formats

Video Signals

Video signals are organized into three different ways :

• Component Video

Page 51: Multimedia apllication imag, video formats

Video Signals

Video signals are organized into three different ways :

• Component Video• Composite Video

Page 52: Multimedia apllication imag, video formats

Video Signals

Video signals are organized into three different ways :

• Component Video• Composite Video• S-Video

Page 53: Multimedia apllication imag, video formats

Component Video

• Make use of three separate signals for red green and blue image plane.(Component Video)

Page 54: Multimedia apllication imag, video formats

Component Video

• Make use of three separate signals for red green and blue image plane.(Component Video)

• This kind of system has three wires (Connectors) for connecting camera or other devices.

Page 55: Multimedia apllication imag, video formats

Component Video

• Make use of three separate signals for red green and blue image plane.(Component Video)

• This kind of system has three wires (Connectors) for connecting camera or other devices.

• Color signal not restricted to always RGB

Page 56: Multimedia apllication imag, video formats

Component Video

• Make use of three separate signals for red green and blue image plane.(Component Video)

• This kind of system has three wires (Connectors) for connecting camera or other devices.

• Color signal not restricted to always RGB• We can form three signal via a luminance-

chrominance transformation (YIQ or YUV)

Page 57: Multimedia apllication imag, video formats

Component Video

• Make use of three separate signals for red green and blue image plane.(Component Video)

• This kind of system has three wires (Connectors) for connecting camera or other devices.

• Color signal not restricted to always RGB• We can form three signal via a luminance-

chrominance transformation (YIQ or YUV)• There are no crosstalk between three different

channels.

Page 58: Multimedia apllication imag, video formats

Component Video

Page 59: Multimedia apllication imag, video formats

YUV

Page 60: Multimedia apllication imag, video formats

YIQ

• YIQ used in NTSC(National Television System Committee)

Page 61: Multimedia apllication imag, video formats

Composite Video

• Color(chrominance) and intensity(Luminance) signal are mixed into single carrier wave.

• Chrominance is a composite of two color component(I and Q or U and V).

• In NTSC TV, I and Q combine into composite chrome signal.

• When connecting to TV or VCR, composite video uses one wire and video color signals are mixed, not sent separately.

Page 62: Multimedia apllication imag, video formats

S- Video

• S-Video uses two wires: One for luminance and other for and other for composite chrominance.

• There is less crosstalk.

Page 63: Multimedia apllication imag, video formats

NTSC(National Television System Committee)

Page 64: Multimedia apllication imag, video formats

PAL

• PAL stands for Phase Alternate Lines

Page 65: Multimedia apllication imag, video formats

Color Models in Videos

• YUV• YIQ• YCbCr

Page 66: Multimedia apllication imag, video formats

YUV

• YUV coding used for PAL.• It codes a luminance signal(for gamma

correction) equal to y’.

Page 67: Multimedia apllication imag, video formats

YUV

• YUV coding used for PAL.• It codes a luminance signal(for gamma

correction) equal to y’.• Chrominance refers to the difference between

a color and a reference white at a same luminance.

Page 68: Multimedia apllication imag, video formats

YUV

• YUV coding used for PAL.• It codes a luminance signal(for gamma

correction) equal to y’.• Chrominance refers to the difference between

a color and a reference white at a same luminance.

• It can be represent by the color differences U , V.

Page 69: Multimedia apllication imag, video formats

YUV

• We go the (Y’,U,V) to (R,G,B) by inverting the matrix.

• Y’ is equal to the same value R’.(coz sum of coefficient is 1)

• For black & white image chroma(UV) is zero.

Page 70: Multimedia apllication imag, video formats

YIQ

• Y’IQ is used in NTSC.• I for in-phase chrominance.• Q for quadrature chrominance.

Page 71: Multimedia apllication imag, video formats

Y component

I component

Q component

Page 72: Multimedia apllication imag, video formats

YCbCr

• Y is the Luma component and Cb and Cr are the blue difference and red difference chroma component.

• Used for digital video encoding digital camera.• YCbCr is used in JPEG and MPEG.

Page 73: Multimedia apllication imag, video formats

YCbCr

Page 74: Multimedia apllication imag, video formats

74

Color Space – Comparison

Color space

Color mixing

Primary parameters

Used for Pros and cons

RGB Additive Red,Green, Blue

Easy but wasting bandwidth

CMYK Subtractive Cyan, Magenta, Yellow, Black

Printer Works in pigment mixing

YCbCrYPbPr

additive Y(luminance), Cb(blue chroma), Cr(red chroma)

Video encoding, digital camera

Bandwidth efficient

YUV additive Y(luminance),U(blue chroma), V(red chroma)

Video encoding for PAL

Bandwidth efficient

YIQ additive Y(luminance),I(rotated from U),Q(rotated from V)

Video encoding for NTSC

Bandwidth efficient

Page 75: Multimedia apllication imag, video formats

Sample Input

Gamma Corrected Input

Monitor Output

    

Graph of Correction L' = L ^ (1/2.5)

Gamma Correction• Gamma correction provides displaying an image accurately on a computer screen. • Images which are not properly corrected can look either bleached out, or too dark.• Trying to reproduce colors accurately also requires some knowledge of gamma. • Varying the amount of gamma correction changes not only the brightness, but also the ratios

of red to green to blue.

Page 76: Multimedia apllication imag, video formats

Introduction to Video Compression

• A video consist of time-ordered sequence of frames(Images).

• An obvious solution to video compression would be predictive coding based on previous frame.

• Exploit spatial redundancy within frames (like JPEG: transforming, quantizing, variable length coding)

• Exploit temporal redundancy between frames

Page 77: Multimedia apllication imag, video formats

Compression in the time domain

• difference between consecutive frames is often small• remove inter-frame redundancy• sophisticated encoding, relatively fast decoding

Page 78: Multimedia apllication imag, video formats

78

Difference Frames

• Differences between two frames can be caused by– Camera motion: the outlines of background or

stationary objects can be seen in the Diff Image– Object motion: the outlines of moving objects can

be seen in the Diff Image– Illumination changes (sun rising, headlights, etc.)– Scene Cuts: Lots of stuff in the Diff Image– Noise

Page 79: Multimedia apllication imag, video formats

79

Motion Estimation

• Determining parameters for the motion descriptions

• For some portion of the frame, estimate its movement between 2 frames- the current frame and the reference frame

• What is some portion?– Individual pixels (all of them)?– Lines/edges (have to find them first)– Objects (must define them)– Uniform regions (just chop up the frame)

Page 80: Multimedia apllication imag, video formats

Motion Estimation

Page 81: Multimedia apllication imag, video formats

MPEG

• Motion Picture Expert Group.• First devised in 1988 by a group of almost 1000

experts(from about 25).• Primary motivations:

– High compression rate for video storage comparable to VHS quality

– Random access capability

• Overall MPEG Standard combines video and audio signal into one large compression algorithm.

Page 82: Multimedia apllication imag, video formats

MPEG-1

• MPEG-1 audio/video digital compression standard was approved by the International Organization for Standardization(ISO) / International Electrotechnical Commission(IEC).

• MPEG-1 adopts the CCIR601 digital TV format also known as SIF (Source Input Format).

• MPEG-1 supports only non-interlaced video. Normally, its picture resolution is:– 352 × 240 for NTSC video at 30 fps– 352 × 288 for PAL video at 25 fps– It uses 4:2:0 chroma subsampling

Page 83: Multimedia apllication imag, video formats

MPEG-1

• The MPEG-1 standard is also referred to as ISO/IEC 11172.

• It has five parts: 1172-1 Systems 11172-2 Video 11172-3 Audio 11172-4 Conformance 11172-5 Software.

Page 84: Multimedia apllication imag, video formats

Digital Video Compression Fundamentals and Standards

842008/12/26

Frames Types• I-frame (Intracoded Frame)

– Coded in one frame such as DCT. – This type of frame do not need previous frame

• P-frame (Predictive Frame)– One directional motion prediction from a previous frame

• The reference can be either I-frame or P-frame– Generally referred to as inter-frame– Consist only changes occurs in previous frames.

• B-frame (Bi-directional predictive frame)– Bi-directional motion prediction from a previous or future frame

• The reference can be either I-frame or P-frame– Generally referred to as inter-frame

Page 85: Multimedia apllication imag, video formats

Digital Video Compression Fundamentals and Standards

852008/12/26

Group of Pictures• The distance between two nearest P-frame or P-frame and I-frame

– denoted by M• The distance between two nearest I-frames

– denoted by N

I B B P B B P B B I

GOP

Bidirectional Motion Compensation

Forward Motion Compensation N=9

M=3

Page 86: Multimedia apllication imag, video formats

Compressed video stream