Reputation: 3213
my question is about the theory of jpeg compression. Wikipedia and various books are always talking from a 8*8 matrix to work with. Do I understand it right, if I got an 16*16 pixel image i got 4 of these 8*8 pixel matrix? And not one Matrix from 0-7, 1-8, 2-9, ... 7-15. If I am right, what is if (image.width mod 8 != 0) OR (image.height mod 8 != 0) ? To i fill the rest of my 8*8 matrix with 0? With the mean value? Thanks
Upvotes: 0
Views: 270
Reputation: 308530
Sometimes the color blocks are subsampled; the blocks in the file are still 8x8, but when expanded again they turn into 16x16 (16x8 and 8x16 are also possibilities).
When the image is decompressed the excess pixels on the right and bottom are cropped off so that the original dimensions are maintained.
Upvotes: 1