5D Library › Computational Aesthetics, Visual Saliency Maps and Cognitive Ergonomics in User Interface Design · 中文
Chapter 6 Can “Looking Good” Be Measured? Type Scales, Aesthetic Measure and Complexity
The first five chapters dealt with whether something can be seen, found and hit. This chapter turns to a harder question: can a layout “looking good” be measured? We take three attempts in turn—deriving type scales from Weber’s law, Birkhoff’s aesthetic-measure formula, and compressed length as a stand-in for Kolmogorov complexity—and finally look at the empirical studies of visual complexity and first impressions.
Type scales: convention or law?
Design systems often arrange font sizes on a “modular scale”: starting from a base size, each step multiplies by a fixed ratio, such as 1.2 (minor third), 1.25 (major third), 1.333 (perfect fourth) or 1.618 (golden ratio). The author’s framework calls this the “Weber–Fechner law of type scales”. Two things need to be separated here.
Weber’s law says that the just-noticeable difference is proportional to the original magnitude: . Applied to font size, it predicts that two sizes can be told apart when their ratio exceeds . Book 34 showed that going from Weber’s law to Fechner’s logarithmic law needs the extra assumption that “every just-noticeable difference is subjectively equal”, which fails for dimensions such as loudness; here it is only recapped. More importantly, Weber’s law gives only a lower bound—the ratio must exceed —and favours none of 1.2, 1.25 or 1.618. The names of musical intervals are borrowed labels and imply no physical or psychological correspondence between font size and pitch.
The program below is the author’s model. We do not know the Weber fraction for judging levels of font size in a real layout (it depends on typeface, distance and whether the two texts are adjacent), so we take three assumed values, 0.03, 0.06 and 0.10, and compute for each ratio how many steps fit between 12 and 72 pixels, how many just-noticeable differences each step contains, and the actual step sizes after rounding to whole pixels.
Calculation
# Modular type scales and size discrimination (the author's model). A scale with ratio r
# gives sizes base * r^k. Under Weber's law a size difference is noticed when
# |s2/s1 - 1| > k_w; the Weber fraction k_w for judging text size in a layout is NOT a
# known constant here: 0.03, 0.06 and 0.10 are illustrative assumptions. Count, for
# each ratio, the steps from 12 px to 72 px, the JNDs per step (ln r / ln(1 + k_w)),
# and what integer-pixel rounding does to the smallest ratios.
import math
RATIOS = [("minor second", 16 / 15), ("major second", 1.125), ("minor third", 1.2),
("major third", 1.25), ("perfect fourth", 4 / 3), ("perfect fifth", 1.5),
("golden ratio", (1 + 5 ** 0.5) / 2)]
def scale(r, base=16, lo=12, hi=72):
up = [base * r ** k for k in range(0, 40) if base * r ** k <= hi]
down = [base / r ** k for k in range(1, 40) if base / r ** k >= lo]
return sorted(down) + up
if __name__ == "__main__":
print("ratio r sizes 12-72 JNDs per step, k_w = .03 .06 .10")
for name, r in RATIOS:
jnd = [math.log(r) / math.log(1 + k) for k in (0.03, 0.06, 0.10)]
print(f" {name:14s} {r:6.3f} {len(scale(r)):8d} {jnd[0]:21.1f} {jnd[1]:4.1f}"
f" {jnd[2]:4.1f}")
print("integer-pixel rendering (base 16 px): smallest and largest rendered step")
for name, r in RATIOS[:3]:
px = [round(x) for x in scale(r)]
st = [b / a - 1 for a, b in zip(px, px[1:])]
print(f" {name:14s} {px[:8]} ...")
print(f" {'':14s} steps {min(st):.1%} to {max(st):.1%} (nominal {r - 1:.1%});"
f" {sum(x < .06 for x in st)} of {len(st)} under 6 %")
print(f"levels in 12-72 px ~ ln 6 / ln r = {math.log(6):.3f} / ln r: a larger ratio")
print(" buys clearer steps with fewer levels; Weber's law singles out no ratio")
# ratio r sizes 12-72 JNDs per step, k_w = .03 .06 .10
# minor second 1.067 28 2.2 1.1 0.7
# major second 1.125 15 4.0 2.0 1.2
# minor third 1.200 10 6.2 3.1 1.9
# major third 1.250 8 7.5 3.8 2.3
# perfect fourth 1.333 7 9.7 4.9 3.0
# perfect fifth 1.500 4 13.7 7.0 4.3
# golden ratio 1.618 4 16.3 8.3 5.0
# integer-pixel rendering (base 16 px): smallest and largest rendered step
# minor second [12, 13, 14, 15, 16, 17, 18, 19] ...
# steps 4.2% to 10.5% (nominal 6.7%); 7 of 27 under 6 %
# major second [13, 14, 16, 18, 20, 23, 26, 29] ...
# steps 7.7% to 15.0% (nominal 12.5%); 0 of 14 under 6 %
# minor third [13, 16, 19, 23, 28, 33, 40, 48] ...
# steps 17.9% to 23.1% (nominal 20.0%); 0 of 9 under 6 %
# levels in 12-72 px ~ ln 6 / ln r = 1.792 / ln r: a larger ratio
# buys clearer steps with fewer levels; Weber's law singles out no ratioBetween 12 and 72 pixels, the minor second (1.067) has 28 sizes, the major second (1.125) 15, the minor third (1.2) 10, the perfect fourth (1.333) 7, and the perfect fifth and golden ratio 4 each; the number of levels is about . How many just-noticeable differences a step contains depends on the assumed Weber fraction: at 0.06, a minor-second step contains only 1.1, so neighbouring levels are barely distinguishable; a minor third contains 3.1 and the golden ratio 8.3. Rounding to whole pixels also makes small ratios uneven: the actual steps of the minor second range from 4.2 % to 10.5 %, with 7 of 27 steps under 6 %; the major second ranges from 7.7 % to 15.0 % and the minor third from 17.9 % to 23.1 %.
The conclusion is a trade-off, not a law: the larger the ratio, the clearer the hierarchy but the fewer the levels available; the smaller the ratio, the more levels but the greater the risk that neighbours cannot be told apart, with rounding to whole pixels adding unevenness. Weber’s law only tells us that the ratio cannot be too small; it cannot pick the best ratio.
Birkhoff’s aesthetic measure
In Aesthetic Measure (1933) the mathematician G. D. Birkhoff proposed that aesthetic value could be written as the ratio of “order” to “complexity”, (Birkhoff 1933). He gave specific scoring methods for polygons, vases, melodies and poems. For polygons, is the number of distinct straight lines carrying the edges, and : is vertical symmetry (0 or 1), equilibrium (−1, 0 or 1), rotational symmetry (scored by the order of rotation), the relation to a horizontal–vertical network (0, 1 or 2), and a deduction for “unsatisfactory form” (Douchová 2015).
Calculation
# Birkhoff (1933) M = O/C for polygons, O = V + E + R + HV - F, C = number of distinct
# lines carrying the edges (V vertical symmetry, E equilibrium, R rotational symmetry,
# HV relation to a horizontal-vertical network, F unsatisfactory form). Then a
# computable stand-in for "complexity": Kolmogorov complexity K(x) is uncomputable, but
# any lossless compressor gives an upper bound K(x) <= |zlib(x)| + O(1). Applied to
# 96 x 64 binary layouts: blank, a strict grid, grid + text lines, the same with random
# jitter, and noise (30 % ink; Shannon bound H(0.3) = 0.881 bit per pixel).
import random, zlib
POLY = [("square", 1, 1, 2, 2, 0, 4),
("rectangle, ordinary ratio (incl. 1.618)", 1, 1, 1, 2, 0, 4),
("equilateral triangle, base down", 1, 1, 1.5, 0, 0, 3)] # R = q/2, q = 3
def bits(img):
flat = [v for r in img for v in r]
return bytes(sum(flat[i + j] << j for j in range(8)) for i in range(0, len(flat), 8))
def layout(kind, rng, w=96, h=64):
img = [[0] * w for _ in range(h)]
if kind == "blank":
return img
if kind == "noise":
return [[rng.random() < 0.3 for _ in range(w)] for _ in range(h)]
for row in range(2):
for col in range(3):
x0, y0 = 4 + 31 * col, 4 + 30 * row
dx = rng.randint(-3, 3) if kind == "jittered grid + text" else 0
dy = rng.randint(-3, 3) if kind == "jittered grid + text" else 0
for y in range(y0 + dy, y0 + dy + 14):
for x in range(x0 + dx, x0 + dx + 26):
img[y][x] = 1
if kind != "strict grid":
for k in range(3):
n = rng.randint(14, 26) if kind == "jittered grid + text" else 22
for x in range(x0 + dx, x0 + dx + n):
img[y0 + dy + 17 + 3 * k][x] = x % 3 != 2
return img
if __name__ == "__main__":
print("A. Birkhoff polygons V E R HV F C M=O/C")
for name, V, E, R, HV, F, C in POLY:
m = (V + E + R + HV - F) / C
print(f" {name:40s} {V} {E:2d} {R:4.1f} {HV} {F:2d} {C:2d} {m:5.2f}")
print(" (every rectangle that is not too elongated scores 1.25: no special 1.618)")
rng = random.Random(1933)
print("B. zlib upper bound on description length, 96 x 64 binary layouts")
print(" layout raw bytes zlib bytes ratio")
for kind in ("blank", "strict grid", "grid + text", "jittered grid + text", "noise"):
z = len(zlib.compress(bits(layout(kind, rng)), 9))
print(f" {kind:26s} {768:9d} {z:11d} {z / 768:6.2f}")
print(f" (raw = 96 x 64 / 8 bytes; the zlib wrapper is 6 bytes, and empty input"
f" -> {len(zlib.compress(b'', 9))} bytes)")
# A. Birkhoff polygons V E R HV F C M=O/C
# square 1 1 2.0 2 0 4 1.50
# rectangle, ordinary ratio (incl. 1.618) 1 1 1.0 2 0 4 1.25
# equilateral triangle, base down 1 1 1.5 0 0 3 1.17
# (every rectangle that is not too elongated scores 1.25: no special 1.618)
# B. zlib upper bound on description length, 96 x 64 binary layouts
# layout raw bytes zlib bytes ratio
# blank 768 15 0.02
# strict grid 768 35 0.05
# grid + text 768 51 0.07
# jittered grid + text 768 125 0.16
# noise 768 749 0.98
# (raw = 96 x 64 / 8 bytes; the zlib wrapper is 6 bytes, and empty input -> 8 bytes)Part A computes three polygons by this definition: the square , a rectangle of ordinary proportions , and an equilateral triangle standing on its base . The second line is the link between this chapter and Chapter 1: Birkhoff’s measure gives every rectangle of ordinary proportions the same score; it cannot distinguish the golden rectangle from other rectangles, and it rates the square higher. (According to Douchová’s account, Birkhoff’s “unsatisfactory form” term penalises a polygon whose smallest distance between vertices is less than a tenth of the largest; for a rectangle this means an aspect ratio above , when falls to 1.0. Whether the “irregularity” clause of the same term penalises nearly square rectangles is unclear from the account, and the book makes no judgement (Douchová 2015).) So even within Birkhoff’s framework, “the golden ratio is most beautiful” does not follow. Birkhoff’s formula drew many criticisms after it was proposed, a common one being that the scoring rules for each term were set by his intuition; its relation to experimentally measured preferences has not been systematically checked for this book and is not pursued here.
Complexity: from Kolmogorov to compressed length
Birkhoff’s is defined separately for each class of object. A more general notion of complexity is Kolmogorov complexity : the length of the shortest program that outputs the string . It is elegant in theory but uncomputable: no algorithm can compute for arbitrary (Li and Vitányi 2008). Any lossless compressor, however, gives an upper bound: , the constant being the length of the decompressor. Compressed length can therefore serve as an upper-bound proxy for complexity, but not as complexity itself: for regularities that the compressor cannot discover (for example “noise” produced by a simple pseudo-random generator), compressed length grossly overestimates.
Part B of the program compresses five 96 × 64 binary layouts (768 bytes raw) with zlib. A blank page compresses to 15 bytes (6 of them the zlib wrapper: a 2-byte header and a 4-byte Adler-32 checksum; even empty input compresses to 8 bytes), a strict grid to 35 bytes, a grid with text lines to 51 bytes, the same with random misalignment to 125 bytes, and random noise with 30 % ink to 749 bytes (ratio 0.98, about 0.975 bits per pixel, still about 11 % above the Shannon bound bits per pixel: zlib can barely compress structureless noise). The order matches intuition: misalignment removes the layout’s repetition and more than doubles the compressed length.
Evidence
Visual complexity and first impressions (summary). Donderi’s 2006 review discusses measures of visual complexity, including the relation between the compressed size of image files and subjective complexity ratings (Donderi 2006). Lindgaard and colleagues (2006) ran three studies: in the first, 22 students viewed 100 home pages for 500 ms each and rated them twice, with high agreement between the two ratings; in the third, 40 participants were randomly split into a 50-ms and a 500-ms group viewing the same 50 home pages, and the two groups’ mean ratings correlated at 0.947 (first round) and 0.953 (second), although agreement between raters was lower at 50 ms (mean r about 0.34–0.40, against about 0.56–0.60 at 500 ms) (Lindgaard et al. 2006). Tuch and colleagues (2012), with 119 website screenshots, found that visual complexity and prototypicality affected aesthetic ratings within 50 ms, and both still did at 17 ms, the effect of prototypicality being weaker; sites of low complexity and high prototypicality were rated most appealing (Tuch et al. 2012). Reinecke and colleagues (2013) collected ratings of 450 websites from 548 volunteers and, with computed complexity and colourfulness plus demographics, explained about half the variance in appeal ratings after 500 ms of viewing (Reinecke et al. 2013). Processing-fluency theory holds that stimuli that are easy to process are experienced as more beautiful (Reber et al. 2004); it can explain the advantage of “low complexity, high prototypicality”, but it is an explanatory framework, not a formula that can be computed directly.
What these studies have in common is that they measure aesthetic ratings made within a few hundred milliseconds, not purchases, sign-ups or any behavioural outcome. “A first impression forms in 50 milliseconds” is a fair summary of Lindgaard and colleagues’ study, but it cannot be stretched to “conversion is decided in 50 milliseconds”. Nor is “the lower the complexity, the better” linear: in Tuch and colleagues’ results complexity acts together with prototypicality, and a page too empty to match users’ expectations of its kind of site may not be rated highly.
Hypothesis · not established · Compressed length and first impressions
The author’s hypothesis (not established): for screenshots of one class of website (say, e-commerce home pages), ranked by the compressed length of their greyscale PNGs, pages of intermediate compressed length receive higher 500-ms aesthetic ratings than those of lowest and highest compressed length (an inverted U). What result would show it wrong: in a pre-registered rating study, the confidence interval for the quadratic coefficient of compressed length includes zero or is positive, or ratings change monotonically with compressed length.
Chapter summary
Modular type scales are design conventions: Weber’s law requires only that the ratio exceed a threshold and cannot choose the best ratio; the choice is a trade-off between clarity of hierarchy and number of levels, and rounding to whole pixels makes small ratios uneven. Birkhoff’s gives every rectangle of ordinary (not too elongated) proportions the same score of 1.25 and the square more (1.50), so no special status for the golden ratio follows. Kolmogorov complexity is uncomputable, and compressed length is only an upper-bound proxy. Visual complexity and prototypicality affect aesthetic ratings within tens of milliseconds (Lindgaard and colleagues 2006, Tuch and colleagues 2012, Reinecke and colleagues 2013), but these studies measure brief ratings, not behavioural outcomes.
References
Fan, Y. (2026). Computational Aesthetics, Visual Saliency Maps and Cognitive Ergonomics in User Interface Design: From the Hick–Hyman Law and Spatial Frequency Channels to Saccadic Trajectory Modelling, Read Beside the Kaogongji and Classical Treatise on Architectural Methods [计算美学、视觉显著性图谱与人机界面认知工程] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23836258 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).