This is a fascinating and subtle question. You're essentially asking:
If I re-encode a grayscale image by packing 8 binary (1-bit) pixels into each byte, and then average those 8 bits to reconstruct the original 8-bit grayscale value per pixel, could lossless compression (like PNG or WebP) compress this new representation better than the original 8-bit grayscale image?
Short Answer:
No, this transformation does not help lossless compression like PNG or WebP. In fact, it hurts compression efficiency.
Why?
1. Loss of Correlation
Grayscale images (especially manga panels) have spatial correlation — nearby pixels tend to have similar values. PNG and WebP exploit this with predictive coding (e.g., PNG uses filters like "up", "left", "Paeth", etc.).
When you pack 8 binary pixels into a byte, you're destroying spatial locality. The bits in a byte no longer correspond to adjacent pixels — they might be from completely different parts of the image. This breaks the spatial correlation that PNG/WebP rely on.
2. Entropy Increases
The original 8-bit grayscale image has low entropy in smooth regions (e.g., white backgrounds, black ink). But when you pack 8 binary pixels into a byte, the resulting byte values become more random — even if the original image was smooth.
For example:
- A smooth white region might be all 255s → very compressible.
- After your transformation, each byte is a mix of 0s and 1s from 8 different pixels → much less predictable.
3. No Real Redundancy Introduced
You're not introducing any new redundancy that the compressor can exploit. You're just repacking the data in a way that obscures the original structure.
Analogy:
Imagine taking a book, cutting every word into individual letters, and then shuffling them into 8-letter chunks. Even if you later average the letters to reconstruct the original words, the shuffled version is much harder to compress because the context is gone.
Bonus: What would help?
If you're trying to increase compressibility, you'd want to:
- Use palette-based encoding (if the image has ≤256 colors).
- Use lossless WebP or AVIF, which often outperform PNG.
- Use context modeling (like FLIF or JPEG XL) that adapts better to image structure.
Conclusion:
Your proposed transformation destroys compressibility rather than enhancing it. Lossless compressors like PNG/WebP are optimized for spatially coherent 8-bit data, not bit-packed, scrambled representations.