Image compression
-
What is the difference between two images looking the same, if one uses compression and the other one doesn’t. For example we have images made of 12 pixels with all pixels having the same color, except the first three which are different then the rest. If we consider a color depth of 24 bit the bitmap version will have 12*24 bit, 288 bit total. In the compressed image the first 3 pixels will weight 24 bit and the other ones another 24 bit, 48 total. The start and end pixels marking a color sequence need to be considered too, that’s index 0, index 2, index 3 and index 11. Is that correct?
-
What is the difference between two images looking the same, if one uses compression and the other one doesn’t. For example we have images made of 12 pixels with all pixels having the same color, except the first three which are different then the rest. If we consider a color depth of 24 bit the bitmap version will have 12*24 bit, 288 bit total. In the compressed image the first 3 pixels will weight 24 bit and the other ones another 24 bit, 48 total. The start and end pixels marking a color sequence need to be considered too, that’s index 0, index 2, index 3 and index 11. Is that correct?
Probably not - it depends on the compression method. There are two different types of image compression: lossless and lossy. PNG for example is lossless - when it is decompressed to a bitmap for display, the bitmap is identical to the original input bitmap data. JPG is lossy - when it is decompressed the resulting image is lower quality than the original. You can prove this with any image editor: load a bitmap, save it as a JPG. Open the JPG, save it as a new JPG. Repeat a few times, and watch how the image size drops, the compare the original with the final result. It doesn't take many iterations before the result as very clear to see. Do the same with a PNG file and the result will be identical to the original. There is also the problem that any form of compression adds overhead to the resulting file to manage the compression - and small files or those containing a high degree of randomisation can end up bigger than the uncompressed original as a result! If you really want to know about image compression, Google / Wiki is the place to start: but be warned that the math gets pretty hairy!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
Probably not - it depends on the compression method. There are two different types of image compression: lossless and lossy. PNG for example is lossless - when it is decompressed to a bitmap for display, the bitmap is identical to the original input bitmap data. JPG is lossy - when it is decompressed the resulting image is lower quality than the original. You can prove this with any image editor: load a bitmap, save it as a JPG. Open the JPG, save it as a new JPG. Repeat a few times, and watch how the image size drops, the compare the original with the final result. It doesn't take many iterations before the result as very clear to see. Do the same with a PNG file and the result will be identical to the original. There is also the problem that any form of compression adds overhead to the resulting file to manage the compression - and small files or those containing a high degree of randomisation can end up bigger than the uncompressed original as a result! If you really want to know about image compression, Google / Wiki is the place to start: but be warned that the math gets pretty hairy!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
Thanks Griff