100 likes | 123 Views
Learn about JPEG compression, including motivation, general methods, step-by-step instructions, and example codes. Explore shifting, Discrete Cosine Transform, quantization processes, and file conversion. Discover how to input multiple file types, adjust quantization matrix, and convert JPEG files back to uncompressed format.
E N D
JPEG Compression in Matlab Michael Christensen
Outline • Motivation • General Method • Still to do…
Motivation • Instruction • Provide a simple example
Method Step 1 Shift by 27
Method, Cont. Step 2 2D Discrete Cosine Transform
Method, Cont. . / Step 3 Quantization
Method, Cont. ( ) = −26, −3, 0, −3, −3, −6, 2, −4, 1, −4, 1, 1, 5, 1, 2, −1, 1, −1, 2, 0, 0, 0, 0, 0, −1, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Method, Cont. ( ) −26, −3, 0, −3, −3, −6, 2, −4, 1, −4, 1, 1, 5, 1, 2, −1, 1, −1, 2, 0, 0, 0, 0, 0, −1, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 Shorten = = −26, −3, 0, −3, −3, −6, 2, −4, 1, −4, 1, 1, 5, 1, 2, −1, 1, −1, 2, 0, 0, 0, 0, 0, −1, −1, EOB 101001110011101111110111010110101011101000011001101110101110101010101101011011101011011110110111010001101110001101111011011000110101010111011101001101111010111011000110011110111010101100110101101110101010011110101110101010
Method, Final File Headers, etc. 101001110011101111110111010110101011101000011001101110101110101010101101011011101011011110110111010001101110001101111011011000110101010111011101001101111010111011000110011110111010101100110101101110101010011110101110101010 + = Output File
Still To Do… • Input multiple file types • Modifiable quantization matrix for variable compression rates • JPEG file conversion back to uncompressed format