compression techniques images & video. compressing images ● gif (graphic interchange format)...
Post on 21-Dec-2015
242 views
TRANSCRIPT
![Page 1: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/1.jpg)
Compression TechniquesImages & Video
![Page 2: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/2.jpg)
Compressing Images
● GIF (Graphic Interchange Format) Codec– employs LZW method for lossless compression
● TIFF (Tagged Image File Format) Codec– lossless syntactic method
● JPEG (Joint Photographics Experts Group) Codec– umbrella term covering several lossy and lossless
methods– baseline method is most commonly used one -- lossy
method based on a hybrid method
![Page 3: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/3.jpg)
Compression:Coping with Large Files
● Compression is an encoding process that filters the original file in several successive stages
![Page 4: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/4.jpg)
Other Methods for Reducing Demands
● Frame rate adjustment– adjusts for with slower CPUs– helps keep video and audio synchronized
● Lower resolution on individual frames– sometimes used in conjunction with smaller display window
![Page 5: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/5.jpg)
Image Format - TIFF
● Tagged image file format● bit-mapped images● Publishing purpose● Incompatible between PC and MAC -> “jumbled picture”● Have built-in compression
![Page 6: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/6.jpg)
Image Format - GIF
● Graphics interchanged format● Suitable for transferring between networks● “indexed color” -> 256 colours● GIF stores image using 1 channel (8 bits)● full-colors (JPEG) = 24 bit RGB color images using 3 bytes data = 8 bit for
each channel● Two types:
– transparent GIF (background is rendered invisible by an operation called masking) – interlaced GIF -> transmitted in progressive mode = at first image appears quickly
but in a coarse or low resolution, in successive steps, its pixels are replaced by better resolution until the image is displayed at full resolution
![Page 7: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/7.jpg)
Image Format - JPEG
● Joint Photographic Expert Groups● a set of standard for compression image -> JPEG file● Popular format using 24-bit, full color images on web● lossy compression technique--> loss can be controlled
--> not noticeable
![Page 8: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/8.jpg)
JPEG Compression
● Adalah piawai yg digunakan utk pemampatan dan penyahmampatan imej berwarna dan tanpa warna (grayscale)
Digunakan dlm audio-graphical videoconferencing, fax berwarna, imej-imej perubatan dan sebagainya
Idea asas utk menukarkan satu blok imej dlm domain masa kepada domain frekuensi.
![Page 9: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/9.jpg)
Proses Pemampatan JPEG
![Page 10: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/10.jpg)
Proses Pemampatan JPEG
Imej dibahagikan kepada beberapa blok dan setiap blok mengandungi kump. 8 X 8 pixels
● Dari domain spatial, blok di transformasikan kepada domain frekuensi menggunakan FDCT (Forward Discrete Cosine Transform)
● Pemampatan Lossy: Pengkuantitian/Quantization Jadual Pengkuantitian
● Kemudian pekali 2 dimensi DCT dikuantitikan menggunakan matriks pengkuantiti, dlm kes ini melibatkan matriks 8 X 8
![Page 11: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/11.jpg)
Selepas proess pengkuantiti selesai, nilai asal imej tidak boleh dikembalikan, dirujuk sbg proses yg ‘lossy’
Pekali DCT yg berfrekuensi tinggi mempunyai nilai yg lebih kecil berbanding dgn yg berfrekuensi rendah
Oleh yang demikian, proses mengkuantiti pekali frekuensi tinggi adalah lebih ‘coarser’/kasar.
● Proses ini menghasilkan beberapa bilangan sifar dlm bahagian frekuensi tinggi pekali 2D DCT.
● Kemudian, pekali-pekali 2D DCT yg telah dikuantitikanakan ditukar kepada matriks 1 dimensi menggunakan Imbas Zig-zag.
![Page 12: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/12.jpg)
● Imbas Zig-zag menghasilkan bilangan-bilangan sifar yg berdekatan antara satu sama lain.
● Pemampatan Lossless: Pengkodan Huffman Jadual Huffman Matriks 1D ini kemudian akan dikodkan menggunakan Jadual Pengkodan
Huffman Proses Pengkodan Huffman merupakan proses pemampatan yg lossless’ Akhirnya Penjana Syntak JPEG akan menjana syntax JPEG iaitu
Aliran Data Yg Telah Dikod yg boleh difahami oleh proses penyahmampatan JPEG
![Page 13: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/13.jpg)
Penyahmampatan JPEG
● Aliran Data Yg Telah Dikod dgn syntax JPEG dinyahkodkan menggunakan Penyahkod/Decorder Syntak JPEG
● Kemudian proses Penyahkodan Huffman akan dilaksanakan menggunakan Jadual Huffman dan matriks 1D dijana bg setiap blok.
● Imbasan Zig-zag akan menukarkan matriks 1D kepada matriks 2D.
![Page 14: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/14.jpg)
● Proses penyahkuantitian akan menggunakan Jadual Pengkuantitian utk menjana pekali 2D DCT
● Dengan menggunakan Inverse DCT (IDCT ), pekali 2D DCT ditransformasi kembali kPada domain spatial (8 X 8 blok pixels), utk membina semula blok-blok.
![Page 15: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/15.jpg)
DCT● Imej yg terdiri drp blok-blok ditukar dari domain ruang ke domain
frekuensi menggunakan DCT. Fungsi ini menukar nilai dlm julat 8-bit setiap pixel blok data (8 X 8
pixels) kepada nilaian pekali 2D perwakilan frekuensi Output proses adalah peta frekuensi yg beri maklumat tentang
maklumat dgn frekuensi tinggi atau rendah dlm segmen blok. ● “Smooth and continuous tones” ditandakan dgn frekuensi rendah. ● Perubahan yg tajam dan dgn tiba-tiba / mendadak dlm keterikan pixel
ditandakan dgn frekuensi tinggi
![Page 16: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/16.jpg)
Perumpukan Nilaian Spatial Perwakilan Keterikan
Warna Dalam Blok
Peta Frekuensi Setelah Fungsi DCT Dilasksanakan Ke Atas Blok
Laksanakan FDCT
![Page 17: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/17.jpg)
DCT
Maklumat peta frekuensi diperlukan fasa Quantization● Dalam proses penyahmampatan JPEG, “Inverse DCT”
akan menukarkan pekali-pekali yg mewakili imej dlm domain frekuensi kembali kepada nilai-nilai pixels dalam domain spatial
![Page 18: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/18.jpg)
Pengkuantitian
● Berdasarkan kepada matriks pengkuantitian Tujuan matriks ini adalah utk kuantitikan pekali-pekali
hasilan DCT Di mana setiap kemasukan pekali-pekali DCT dlm peta
frekuensi dibahagikan dgn kemasukan nilai kuantiti yg sepadan dari matriks kuantum
Hasil akan dibulatkan kepada nilai integer yg paling hampir.
![Page 19: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/19.jpg)
Matriks Kuantiti / Kuantum (MK)
Peta Frekuensi / MK =
Peta Frekuensi
Matriks Hasil
![Page 20: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/20.jpg)
Pengkuantitian (Cth)
Katakanlah nilai pekali DC adalah –80 dan nilai kuantiti matriks yg sepadan dgnnya adalah 16. Pembahagian antara 2 nilai akan menghasilkan nilai –5.
● Ulangi proses utk kesemua kemasukan pekali dalam blok 8 X 8
● Di dapati bahawa bahagian yg berfrekuensi tinggi dlm blok akan diwakili dgn unsur/hasilan sifar dan sebaliknya, selepas selesai prosen pengkuantitian.
● Merupakan proses yg lossy di mana nilai integer yg dibulatkan tidak boleh dibina semula menjadi yg asal oleh pengkodan
![Page 21: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/21.jpg)
Teknik Mengimbas
● Selepas proses pengkuantitian, cuma bahagian yg berfrekuensi rendah dlm blok mengandungi pekali yg tidak sifar.
Utk mengurangkan bil. bits yg diperlukan utk storan dan komunikasi, pekali-pekali sifar dapat diletakkan bersama melalui perwakilan imbas zig zag
Proses imbasan zig zag atas pekali-pekali akan menghasilkan satu jujukan nombor seperti 0,2,1,-1,0,0,1,0,1,1,0,0,…
![Page 22: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/22.jpg)
Imbas Zig-zag
![Page 23: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/23.jpg)
Teknik Mengimbas
Kemudian pengkodan Run-Length boleh digunakan utk mengurangkan bil. bits yg diperlukan utk mewakilkan unsur sifar
● Iaitu, selepas proses mengimbas selesai, pengkodan jenis Run-Length dan Huffman dilaksanakan ke atas bit tersebut (perwakilan 1D Matriks) utk memperolehi bilangan bits yg optima
![Page 24: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/24.jpg)
Jenis / Mod Pemprosesan JPEG
● Mod Berjujukan● Mod Progresif● Mod Hierarki● Mod Lossless
![Page 25: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/25.jpg)
Mod Berjujukan
Imej dikod dlm tertib imbas raster dr. kiri ke kanan dan dr atas ke bawah
Mudah dan sesuai utk kebanyakan sistem Menggunakan satu laluan tunggal melalui data utk
mengkod imej dan menggunakan 8 bit resolusi bg setiap input
![Page 26: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/26.jpg)
Mod Progresif● Imej dikod dlm multi-imbas sama ada dr imej pudar (frekuensi
rendah) ke imej yg tajam (frekuensi tinggi) atau dr bits bererti yg paling penting ke bits bererti yg paling rendah
Imej ditukarkan kPada domain frekuensi menggunakan DCT. Mod ini berguna bg penghantaran imej melalui saluran dgn
bandwidth/kelebaran yg terhad di mana pengguna boleh dipersembahkan dgn keseluruhan gambar secara kasar dahulu sebelum memperolehi gambar yg jelas dan terang jimat masa drPada menanti kejelasan bg gambar yg tidak dikehendaki.
Proses penyahmampatan pula dibina dr imej pudar ke imej yg jelas Mod ini meningkatkan keupayaan mod sebelumnya dlm memenuhi
keperluan aplikasi yg memerlukan resolusi yg lebih tinggi
![Page 27: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/27.jpg)
Mod Hierarki
● Imej dikod menggunakan imej resolusi yg rendah sbg asas utk mengkod imej yg sama dgn resolusi yg lebih tinggi
● Mod ini beri lebih kemudahlenturan utk beberapa jenis peralatan dgn resolusi yg berbeza
![Page 28: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/28.jpg)
Mod ‘Lossless’
Pembinaan semula imej asal secara tepat● Digunakan bg imej yg memerlukan pemampatan
‘lossless’ sbg cth bg imej perubatan yg kritikal
![Page 29: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/29.jpg)
Digital Video The Entire Process Illustrated
![Page 30: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/30.jpg)
Compressing Video
● Video compression employs both spatial and temporal compression– spatial techniques compress individual frames– temporal methods compress data in frames over time
● QuickTime and AVI (Audio Video Interleaved) are two popular (and incompatible with each other) formats
![Page 31: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/31.jpg)
Compressing VideoSome Additional Methods
● DVI (Digital Video Interactive)
● Motion-JPEG
● MPEG (Motion Pictures Experts Group)
● The px64 Standard
![Page 32: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/32.jpg)
Temporal Compression in Video
● Lossy strategies for eliminating redundancy of information between frames employ temporal compression -- referred to as interframe compression
● Sequence of frames are considered together– key frames– difference frames
● Used in QuickTime and DVI
![Page 33: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/33.jpg)
Temporal Compression in Video (cont’d)
● MPEG and related codecs employ a more complex frame-referencing method– intrapictures (I pictures)– predicted pictures (P pictures)– bidirectional pictures (B pictures)
![Page 34: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/34.jpg)
Compressing Audio
● Widely used method is ADPCM (Adaptive Differential Pulse Code Modulation)
● ADPCM– lossy method– employs a differencing technique related to those
used in video compression– used in DVI
![Page 35: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/35.jpg)
Summary
● Compressing data means reducing the effective size of a data file for storage or transmission
● Particular paired compression/decompression methods are called codecs
● Codecs that cannot reproduce the original file exactly are called lossy methods; those that reproduce the original exactly are called lossless methods
● Text and numbers usually require lossless methods● Images, video, and sound codecs are usually lossy
![Page 36: Compression Techniques Images & Video. Compressing Images ● GIF (Graphic Interchange Format) Codec – employs LZW method for lossless compression ● TIFF](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649d595503460f94a38dd5/html5/thumbnails/36.jpg)
Summary
● Syntactic methods attempt to reduce the redundancy of symbolic patterns in a file without any regard to the type of information represented
● Semantic methods exploit characteristics inherent in the type of information being represented
● The use of codecs is not an exact science -- the effectiveness and suitability of any method will depend on the exact nature of the original file and the intended use for the compressed file