Block averaging of an image

Can we reduce the size of an image if we average the pixels in a block of given size, reducing the colors by a factor, while increasing the size of the homogenous regions? Taking every 2x2 block and replacing it with its average is unable to significantly reduce image size. In a quick test with 3 photos, the average improvement was only 6.7%. But with a small block size, much of the perception about the original image is preserved.

Original image

Original image

Image with averaged blocks of size 2

Image with averaged blocks of size 2

In this last image, we have to look carefully in order to distinguish the jaggedness in the corners of the bottle or in the contour of the leaves. The first image is 40.4kB, while the second is 38.5kB, using the same image saving method. But if our image was much smaller, that effect would have been more obvious. We also notice the newly formed row of black pixels at the bottom.

What happens if we test all block sizes from 2x2 to 15x15 on the same image?

Effect of block size on image size

In the image of the bottle and the leaves, larger averaged blocks mostly lead to smaller size. But some block sizes give better results than others. An 8x8 block achieves a smaller image size than a 15x15 block here. In fact, the size becomes only 47.39% of the original (19141 vs 40386 bytes). Apart from the negative effects.

Image with averaged blocks of size 8

Image with averaged blocks of size 8

Is it still possible to say that this image shows a bottle and leaves? Perhaps. But we can see significantly better than this, having to process more than twice this information. This reminds us about the way bees see the world through their compound eyes—in patches of individual colors. Lower resolution that is still sufficient might reduce the cognitive load.