Caveat Lector: This is a Junk Drawer post, which means it’s extra niche and deep-weeds technical. This is part four of an ongoing series documenting (in excessive detail) my recent exploration of a complexity rabbit hole — a journey inspired by
’s April post, A Formula for Meaningful Complexity.That post, and parts 1, 2, and 3 of this series are required reading to make sense of this post.
I’m picking up where I left off: looking at pictures. The final image from last time was this one (which is 1272×716 pixels):
Which I show here in case you want to compare it with the 10% perturbation noise version from last time. While that image looked reasonably clear, if you compare it with this one, you’ll see the difference — a difference that made that version compressible to only 95% in contrast to the 65% of this one.
We’d like to see what numbers we get with some simple images. Rahi used the French and Belize flags in his post. For variety, I’ll use the flags of Norway (where my grandparents came from), the UK, and the USA.
When we create a noise series and generate graphs, we get the same kind of curves but with much more compression along the curve. Here’s the chart for the Norwegian flag:
Here’s the chart for the UK flag:
And here’s the chart for the USA flag:
The max, AC, SS, EF, and ESC values for the three are:
Norway (1280×931): 3,575,094; 7,534; 0.997893; 1.404463; 10,558.93
UK (1280×640): 2,457,654; 12,355; 0.994973; 1.398657; 17,193.53
USA (1280×674): 2,588,214; 26,187; 0.989882; 1.393611; 36,125.25
Note the very high SS values — all approaching 1.0. The EF values are all essentially the same — 1.4. The low ESC values, despite the large file sizes, tracks with these flag images having much less structure than camera photos.1
The Norwegian flag stands out for its larger file size and how small its compressed size is — a mere 0.2% of the original. The UK flag compresses to 0.5% while the USA flag compresses to 1.0%. I suspect the diagonal lines in the UK flag make is less compressible, and the stars in the USA flag make it the least compressible (though still highly compressible — SS value still close to 1.00).
Looking for something on the other end of complexity, I grabbed two Mandelbrot plots from my library:
Way back when, I generated these in 4000×4000 resolution. For these tests, I made copies in 2000×2000 and 1000×1000.
Here is the chart for “Mandelbrot 01” (2000×2000 size):
And here is the chart for “Mandelbrot 02” (ditto):
Despite the detail, the “02” image compresses rather well (due to all the blank space, I imagine). Because I use BMP files here, both 2000×2000 images have the same file size — 12,000,054 bytes — but “02” compresses to 2,300,012 bytes (19% of its original size) while “01” compresses to 6,717,296 bytes (only 56%).2
This is, of course, reflected in their SS, EF, ESC numbers:
“01” (1000×1000): 0.374774; 1.831591; 1,287,549.93
“01” (2000×2000): 0.440228; 1.846860; 5,461,426.02
“01” (4000×4000): 0.452212; 1.845582; 21,944,700.24
“02” (1000×1000): 0.781643; 1.464403; 749,835.09
“02” (2000×2000): 0.808333; 1.446915; 2,690,069.83
“02” (4000×4000): 0.827108; 1.456268; 9,995,871.52
As usual, SS rises with file size. The EF values are fairly stable over different image sizes but different between the “01” and “02” images. The ESC value for “01” in the 4000×4000 resolution is the highest in any file so far. The image resolution is comparable to the 4032×3024 image size of the camera photos from last post.
In the photo set, the highest ESC was for “Oranges” — 16,129,876.81. Which surprised me, by the way, because “Trees” was by far the less compressible image — far more detail — but had an ESC of only 7,136,494.34 (in contrast to “Tree” — the most compressible — which had an ESC of 14,213,566.09 — not too far from “Oranges”).
The final image I thought to try is a simple graphic I made a while back:
I only have this in 425×370 resolution (a mere 472,174 bytes) but was curious to see how it fared:
Unsurprisingly, it compresses very well — to 19,193 bytes, only 4% of its original size.
That’s it for images. Next time I’ll get into text files, adding noise to those, and seeing what their SS, EF, and ESC values are. I will say their smaller file sizes (ranging from 22 Kbytes to 200 Kbytes) make for much smaller ESC values. They range from just over 9,000 to just over 114,000. And while the larger value is indeed for the largest text file, the smaller one isn’t. More on that next time.
Noise Modes
I’ll end with a bit about image noise modes. I wrote last time about “mode 0” noise — replacing a certain percentage of pixels with completely randomly generated ones. For 10% noise, replace 10% of the pixels. I wrote also about “mode 7” noise — perturbing all pixels to a certain percentage. For 10% noise, move each pixel 10% away from its original value.
“Mode 7” implies modes 1 through 6. Here’s the list of image noise modes:
Mode 0: Replace X% of pixels with random colored pixels.
Mode 1: Replace X% of pixels with random grayscale pixels.
Mode 2: Replace X% of pixels with black pixels.
Mode 3: Replace X% of pixels with 50% grey pixels.
Mode 4: Replace X% of pixels with white pixels.
Mode 5: Fade all pixels X% towards black.
Mode 6: Fade all pixels X% towards white.
Mode 7: Perturb all pixels X% towards (color) randomness.
It turns out that “mode 1” isn’t very useful, and modes 2 through 6 don’t come into play until later in this series when I discuss compression curves for images that progress from blank to image to random noise. Rather than the clear image at one end of the series (as done so far), it’s in the middle.
Such a series always runs from highly compressible (the blank image) to incompressible (the random image). What seems useful is where the clear image is on the curve. It will have a characteristic compressibility — a center point on the curve that controls its overall shape. I introduced this idea in the first post and will return to it later. Image noise modes 2 through 6 are used to create the blank-to-image series. The blank can be all white, all gray, or all black, and the progression to the clear image can involve replacing pixels (modes 2-4) or fading the image’s pixels from white or black (modes 5 & 6).
Here’s 50% “mode 0” noise (used in the examples so far):
Here’s 50% “mode 1” noise (which isn’t useful because even 100% replacement of all pixels doesn’t result in an incompressible file — various shades of gray are not random enough):
Here’s 50% “mode 2” noise (50% black pixels):
Here’s 50% “mode 3” noise (50% gray pixels):
Here’s 50% “mode 4” noise (50% white pixels):
Here’s 50% “mode 5” noise (all pixels 50% faded to black):
Here’s 50% “mode 6” noise (all pixels 50% faded to white):
Here’s 50% “mode 7” noise (all pixels 50% perturbed randomly):
I was curious about fading in doing pixel replacement (modes 2-4) versus actually fading the pixels (modes 5 & 6). It turns out to make a noticeable (and to me a bit surprising) difference in the compression curve, but more on that when I come around to discussing the “crossfade” compression curves that run from blank to image to random noise.3
Until next time…
The comparable image sizes would be the 1200×900 ones.
The file sizes for the three resolutions are: 3,000,054 (1000×1000), 12,000,054 (2000×2000), and 48,000,054 (4000×4000).
I must be off my game today. Only two footnotes!