Formats and Transforms

download Formats and Transforms

of 39

Transcript of Formats and Transforms

  • 8/14/2019 Formats and Transforms

    1/39

    IntroductionList of file formats

    Transforms

    SPEECH AND IMAGE PROCESSING LAB

    Image file formats

    Blessin Joseph & Pilmy PeterM.Tech Signal Processing

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    2/39

    IntroductionList of file formats

    Transforms

    INTRODUCTION

    Image file format

    Provide a standardized method of organizing and storing image data.eg: JPEG, TIFF, PNG, GIF

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    3/39

    IntroductionList of file formats

    Transforms

    bmp file formatgif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    List of File Formats

    List of File Formats

    1 BMP

    2 GIF

    3 PNG

    4 JPEG

    5 TIFF

    6 PCX7 XBM

    8 PPM

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    4/39

    IntroductionList of file formats

    Transforms

    bmp file formatgif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    BMP File Format

    Short for bitmapped graphics format.

    Simple graphics file format.

    Usually not compressed.Unsuitable for transferring images on the Internet or other slow orcapacity-limited media.

    Features

    File extension : .bmp or .dibType : image

    Type code : BMP

    Developed by : Microsoft

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    b fil f

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    5/39

    IntroductionList of file formats

    Transforms

    bmp file formatgif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    BMP File Format contd...

    File Structure contains blocks of data.1 Bitmap Header : General information about the file.

    2 Bitmap Information : Detailed information about the image.

    3 Color Palette : Details of colors used for indexed color bitmaps.

    4 Bitmap Data : Actual image in pixel by pixel.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    6/39

    IntroductionList of file formats

    Transforms

    bmp file formatgif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    BMP File Format contd...

    Bitmap header structure

    Bitmap information structureapplication detailed information to display the image on the screen.

    Matches the header used internally (Windows and OS/2) & hasdifferent variants.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    7/39

    IntroductionList of file formats

    Transforms

    bmp file formatgif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    BMP File Format contd...

    Color palette

    Each pixel stored using one or more bytes.

    Tells the application the actual color that each pixel corresponds to.

    Uses RGB color model.

    Number of entries - number of colors used in the picture (4 bytes -Windows & 3 bytes - OS/2).

    Color palette is not used when the bitmap is 16-bit or higher.

    Bitmap dataBottom left corner - left to right - row by row (bottom to top).

    In a horizontal line, number of bytes not divisible by 4, then padwith null-bytes.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    8/39

    IntroductionList of file formats

    Transforms

    bmp file formatgif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    GIF File Format

    Short for Graphics Interchange Format.

    Lossless data compression.

    Palette up to 256 distinct colors from the 24-bit RGB color space.

    Supports animations.

    Features

    File extension : .gif

    Type : bitmap image formatType code : GIF

    Magic : GIF87a/GIF89a

    Developed by : CompuServe, 1987

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    9/39

    IntroductionList of file formats

    Transforms

    bmp file formatgif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    GIF File Format contd...

    Two versions: 87a & 89a(GIF87a and GIF89a).

    Distinguished by the first six bytes of the file.

    GIF89a : Support multiple images in a stream.

    Suitable for sharp-edged line art (logos).

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    10/39

    IntroductionList of file formats

    Transforms

    pgif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    PNG File Format

    Short for Portable Network Graphics.

    Lossless data compression.

    Created to improve upon and replace the GIF format.

    Supports palette-based (24-bit RGB) or greyscale or RGB images.

    Designed for transferring images on the internet, not professionalgraphics.

    Features

    File extension : .png

    Type : lossless bitmap image format

    Type code : PNGf

    Developed by : PNG Development Group, October 14, 1996

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    11/39

    IntroductionList of file formats

    Transforms

    gif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    PNG File Format contd...

    PNG header structure

    Chunks

    Compatibility with older versions.

    Chunk have header specifying their size and type.

    Immediately followed by the actual data & checksum of data.

    4 letter case-sensitive name.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    12/39

    IntroductionList of file formats

    Transforms

    gif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    PNG File Format contd...

    Color depth

    Use palette-indexed color or made up of one or more channels.

    Number of channels depends on greyscale or color & alpha channel.

    Animation

    MNG : An extension to PNG - supports animation.

    More complex than PNG.

    APNG : Based on PNG, supports animation and is simpler thanMNG.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatif fil f

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    13/39

    IntroductionList of file formats

    Transforms

    gif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    PNG File Format contd...

    Comparison with GIF

    Greater compression than GIF.

    Wider range of color depths than GIF.

    GIF supports animation while PNG does not.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatgif file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    14/39

    IntroductionList of file formats

    Transforms

    gif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    JPEG File Format

    Short for Joint Photographic Experts Group.

    Lossless & Lossy compression.

    Storing and transmitting photographs on the World Wide Web.Not suitable for line drawings and other textual or iconic graphics

    Features

    File extension : .jpeg, .jpg, .jpe

    Type : image/jpeg

    Type code : JPEG

    Developed by : Joint Photographic Experts Group, 1992

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatgif file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    15/39

    IntroductionList of file formats

    Transforms

    gif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    JPEG File Format contd...

    JPEG codec

    Encoding

    Color space transformation: RGB into YCbCr.

    Downsampling/ Chroma subsampling : Reduce the Cb and Crcomponents.

    Block splitting: Each channel splitted into 88 blocks(pixels).

    Discrete cosine transform: Each component of each 88 blockconverted to frequency-domain.

    Quantization: Divide each component by a constant for thatcomponent, & round to the nearest integer.

    Entropy coding: Arrange image components in zigzag order - RLEalgorithm - Huffman coding.

    Compression ratio and artifacts: Compression ratio can be varied by

    varying divisors used in the quantization phase.Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatgif file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    16/39

    IntroductionList of file formats

    Transforms

    gif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    TIFF File Format

    Short for Tagged Image File Format.

    Lossy and lossless compression.

    For high color depth images.

    Supported by Adobe Photoshop, GIMP, Corel Photo-Paint.

    Format for raster graphics.

    Features

    File extension : .tiff, .tifType : image

    Type code : TIFF

    Developed by : Aldus, now Adobe Systems, 1980

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatgif file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    17/39

    IntroductionList of file formats

    Transforms

    gif file formatpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    TIFF File Format contd...

    Flexible and adaptable file format.

    Used as container for JPEG and RLE compressed images.Useful method for archiving images.

    Begins with 2-byte indicator of byte order: II for little endian andMM for big endian byte ordering.

    Following 2 bytes represent the number 42.Composed of small descriptor blocks containing offsets into the file.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatgif file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    18/39

    IntroductionList of file formats

    Transforms

    gpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    PCX File Format

    Short for Pacific Exchange.

    Lossless bitmap image format.

    Uses simple form of run-length encoding.

    Supports palette-based and 24-bit RGB images.

    Features

    File extension : .pcxType : lossless bitmap image format

    Developed by : ZSoft Corporation.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatgif file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    19/39

    IntroductionList of file formats

    Transforms

    gpng file format

    jpeg file formattiff file formatpcx file formatxbm file formatppm file format

    PCX File Format contd...

    File Format

    Device-independent bitmap image format.

    File header stores information about the display hardware.

    Compressed using run-length encoding.

    MSB used as control flag - whether given data represents a singlepixel of a given palette index or color value / RLE pair - a series ofseveral pixels of a single value.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatgif file format

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    20/39

    IntroductionList of file formats

    Transforms

    png file formatjpeg file formattiff file formatpcx file formatxbm file formatppm file format

    XBM File Format

    Short for X BitMap.

    ASCII monochrome image format.Stores cursor and icon bitmaps used in the X GUI.

    Can be compiled directly into an application without anypreprocessing steps.

    Data appears in headers & consist of series of static unsigned char

    arrays containing the monochrome pixel data.Image data consists of a line of pixel values stored in a static array.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    bmp file formatgif file format

    fil f

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    21/39

    IntroductionList of file formats

    Transforms

    png file formatjpeg file formattiff file formatpcx file formatxbm file formatppm file format

    PPM File Format

    Short for Portable Pixmap file format.

    PPM, PGM, PBM specify rules for exchanging graphics files.

    Features

    File extension : .ppm, .pgm, .pbm, .pnm

    Type : Image file formats

    Developed by : Jef PoskanzerExtended to : XPM

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    22/39

    DFT

  • 8/14/2019 Formats and Transforms

    23/39

    IntroductionList of file formats

    Transforms

    DFTDCTHadamard TransformWavelet Transform

    Transforms

    DFT, DCT, Hadamard Transform, Wavelets

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    DFT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    24/39

    IntroductionList of file formats

    Transforms

    DFTDCTHadamard TransformWavelet Transform

    DFT Transform

    Short for Discrete Fourier Transform.

    Expresses i/p fn. as sum of sinusoidal components.

    Input function is discrete and finite.

    Used to analyze the frequencies contained in a sampled signal, tosolve partial differential equations, & to perform convolutions.

    Computed using fast Fourier transform (FFT) algorithm.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    I d iDFT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    25/39

    IntroductionList of file formats

    Transforms

    DFTDCTHadamard TransformWavelet Transform

    DFT Transform contd...

    2D - DFT

    v(k, l) =

    m

    n u(m, n)W

    kmN W

    lnN , where k,l=0,1..N-1

    2D - IDFT

    u(m, n) = 1

    N2 kl v(k, l)WkmN WlnN , where m,n=0,1..N-1

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    I t d tiDFT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    26/39

    IntroductionList of file formats

    Transforms

    DCTHadamard TransformWavelet Transform

    DFT Transform contd...

    PropertiesInvertible linear transformation.

    Orthogonality condition is satisfied.

    Parsevals theorem is satisfied.

    DFT sequence is periodic.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionDFT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    27/39

    IntroductionList of file formats

    Transforms

    DCTHadamard TransformWavelet Transform

    DCT Transform

    Short for Discrete Cosine Transform.

    Fourier-related transform.Uses only real numbers.

    8 standard DCT variants.

    The DCT-II - for lossy data compression - energy compactionproperty.

    Used in JPEG image compression, MPEG, and video compression.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionDFT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    28/39

    IntroductionList of file formats

    Transforms

    DCTHadamard TransformWavelet Transform

    DCT Transform contd...

    2D - DCT

    c(k, l) = (k)(l)

    mnx(m, n) cos

    (2m+1)

    2N k

    cos

    (2n+1)2N l

    ,

    where k,l=0,1..N-1

    2D - IDCT

    x(m, n) =

    m

    n (k)(l) c(k, l) cos

    (2m+1)

    2N k

    cos

    (2n+1)2N l

    ,

    where m,n=0,1..N-1

    (k) = 1N

    , for k=0

    =

    2N

    , for k=1,2,..N-1

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionDFTDCT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    29/39

    IntroductionList of file formats

    Transforms

    DCTHadamard TransformWavelet Transform

    Hadamard Transform

    Known as Walsh-Hadamard transform, Walsh transform, orWalsh-Fourier transform.

    Named after the French mathematician Jacques Hadamard.

    Equivalent to a multidimensional DFT of size 2 x 2 x ...x 2.

    Takes only binary values 1 - no multiplications required intransform calculation.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionDFTDCT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    30/39

    List of file formatsTransforms

    DCTHadamard TransformWavelet Transform

    Hadamard Transform contd...

    Hadamard transform Hm

    is a 2mx2m matrix, given by,

    Hm=12

    Hm1 Hm1Hm1 Hm1

    ,

    where 12

    is the normalization factor.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionDFTDCT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    31/39

    List of file formatsTransforms

    DCTHadamard TransformWavelet Transform

    Hadamard Transform contd...

    Examples:

    H0 = +1

    H1 =12

    1 11 1

    H2 =12 H1 H1H1 H1

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionDFTDCT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    32/39

    List of file formatsTransforms

    DCTHadamard TransformWavelet Transform

    Hadamard Transform contd...

    Hadamard Transform of an N x 1 vector u is given as,

    v = Hu

    The inverse transform is given by,

    u = Hv

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionLi f fil f

    DFTDCT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    33/39

    List of file formatsTransforms

    DCTHadamard TransformWavelet Transform

    Wavelet Transform

    Based on small waves - wavelets( scaled and translated copies ofvarying frequency & limited duration ).

    Powerful approach to multiresolution theory-Mallat, 1987.wavelet - Morlet and Grossmann - French word ondelette,meaning small wave - transferred to English - onde into wave

    Used for non-stationary i/p signals.

    Gives both time & frequency information at the same time.

    Classified into discrete wavelet transforms (DWTs) & continuouswavelet transforms (CWTs).

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    34/39

    IntroductionList of file formats

    DFTDCT

  • 8/14/2019 Formats and Transforms

    35/39

    List of file formatsTransforms

    Hadamard TransformWavelet Transform

    Wavelet Transform contd...

    CWT

    CWT off

    (t

    ) w.r.t wavelet (t

    ) is given as,

    W(a, b) = f(t)

    1|a|

    tba

    dt

    where a, b are real.

    a-scaling parameterb-location parameter

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionList of file formats

    DFTDCT

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    36/39

    List of file formatsTransforms

    Hadamard TransformWavelet Transform

    Wavelet Transform contd...

    DWTDWT of f(t) w.r.t wavelet (t) is obtained by puttinga = 2j & b = k2j in CWT

    W(a, b) =

    f(t)2

    j/2 (2jt k)dt

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionList of file formats

    DFTDCTH d d T f

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    37/39

    List of file formatsTransforms

    Hadamard TransformWavelet Transform

    Wavelet Transform contd...

    Wavelet Vs Fourierwavelet-localized in both time and frequency.

    fourier-localized in frequency.

    DWT is computationally less complex.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionList of file formats

    DFTDCTH d d T f

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    38/39

    TransformsHadamard TransformWavelet Transform

    Wavelet Transform contd...

    ApplicationsDWT-data compression.

    CWT-signal analysis.

    JPEG 2000-uses biorthogonal wavelets.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    IntroductionList of file formats

    DFTDCTHadamard Transform

    http://find/http://goback/
  • 8/14/2019 Formats and Transforms

    39/39

    TransformsHadamard TransformWavelet Transform

    References

    1 www.wikipedia.org2 Digital Image Processing in MATLAB,Rafael C. Gonzalez ,

    Richard E. Woods.

    3 Fundamentals of Digital Image processing, Anil K. Jain.

    Blessin Joseph & Pilmy Peter M.Tech Signal Processing SPEECH AND IMAGE PROCESSING LAB Image file formats

    http://find/http://goback/