Fourier against Haar wavelets for compression
Two transforms, the same images, compression ratios from 2 to 50. A direct look at what a basis choice actually buys you.
The question
Transform coding keeps the largest coefficients and discards the rest. Which coefficients are large depends entirely on the basis, and the two classical choices fail in visibly different ways.
Approach
Implemented both pipelines from scratch, including the Haar transform and its inverse at multiple decomposition levels, and compressed three standard images at ratios from 2 to 50 with SNR measured across the whole sweep.
Outcome
At the same ratio the two look nothing alike. Fourier smears error globally as ringing around edges, since a discarded sinusoid affects the entire image. Haar concentrates error locally into blocks, since its basis functions have compact support.
What it taught me
Where your error goes is a property of your basis, not of your compression ratio. This is the intuition I use now to think about why a continuous field and a voxel lattice fail differently on the same anatomy.