Intermezzo: Spectral Editing

The distribution of magnitudes of coefficients strikes another symmetry, for they typically form distributions like sand piles, the so-called Gaussian distribution, around the origin. Almost always, when an image is translated from the spatial to the spectral, the high magnitude coefficients cluster around the origin, with the origin itself usually having the largest magnitude. There is no mathematical edifice compelling such a result, but it is a norm among the general run of images and a common enough de facto rule for spectral editing, an example following:

gmic -input cheese.png \
-fft \
-shift 50%,50%,0,0,2 \
-input 100%,100%,1,1 \
-ellipse[-1] 200,200,80,80,0,1,1 \
-to_rgb[-1] \
-mul[-3,-2] [-1] \
-remove[-1] \
-shift -50%,-50%,0,0,2 \
-ifft[-2,-1] \
-remove[-1] \
-normalize[-1] 0,255 \
-output[-1] cheese_decimated.png
 
cheese.png
cheese_decimated.png
Figure 6: Left: 100 calorie slice. Right: 12 calorie slice. Enjoy.

Of the variations riding on the positive bias, the low frequency signals have the largest amplitudes. For example, the G'MIC pipeline illustrated in the top panel of Figure 6 elides all but about 12% of the coefficients in the spectral domain representation of the cheese and antipasto, leaving only the immediate region around the origin populated, the remainder zero. Such a substantial erasure suggests an almost complete destruction of the image, but in fact, nothing of the sort happens. Indeed, the modified image is almost identical to the original, as most of the information which defines the image allies with the coefficients around the origin.

Because of this, one can “spectrally compress” an image by just discarding a large percentage of the coefficients around the Nyquist pole. Information is lost. The slight blurring and the ringing pattern around edges in Figure 6, right, tells as much, but where image transmission or storage is costly, these defections are but a small price to be paid. It is also common to ply the other side of this phenomenon and elide all but the high frequency components. This will fetch up the image edges when synthesis morphs spectral coefficients into spectral waveforms.

If you want to examine this phenomenon in its entirety, David Tschumperlé has written a nice demo, -x_fourieri, which illustrates this style of spectral editing. Go off now, type gmic -x_fourier in your favorite shell and idle away some minutes; we'll wait here.


A Revised Map A Wave Painting Workflow

iAnd for those of you who are Gimp-centric, Get Ye to Filters → G'MIC → Various → Games & Demos and choose “Fourier Filtering”