5D Library › 计算美学、视觉显著性图谱与人机界面认知工程 · English

第六章 能否度量「好看」:字号阶梯、审美度量与复杂度

前五章讨论的是能否被看见、被找到、被点中。本章转向一个更难的问题:一个布局「好看」能否度量?我们依次讨论三种尝试:用韦伯定律推出字号比例,伯克霍夫的审美度量公式,以及用压缩长度代替柯尔莫哥洛夫复杂度;最后看视觉复杂度与第一印象的实证研究。

字号阶梯:惯例还是定律

设计系统常用「模块化比例」安排字号:从基准字号出发,每一级乘以一个固定的比例,例如 1.2(小三度)、1.25(大三度)、1.333(纯四度)或 1.618(黄金比)。作者框架把这称为「韦伯—费希纳字体阶梯律」。这里需要区分两件事。

韦伯定律说,刚好能分辨的差异与原有刺激量成比例:ΔI/I=k\Delta I / I = k。用到字号上,它预测两个字号之比超过 1+k1 + k 时可以分辨。第 34 本已经说明,从韦伯定律到费希纳的对数定律还需要「每个最小可觉差主观上等大」这一额外假设,而这一假设在响度等维度上并不成立;这里只回顾。更重要的是:韦伯定律只给出一个下限——比例必须大于 1+k1 + k——它并不偏爱 1.2、1.25 或 1.618 中的任何一个。音乐音程的名字只是借来的标签,不表示字号与音高之间有任何物理或心理上的对应。

下面的程序是作者的模型。我们不知道在真实布局中判断字号层级时的韦伯分数是多少(它取决于字体、距离、两段文字是否相邻等),所以取 0.03、0.06、0.10 三个假设值,计算每种比例在 12–72 像素之间有几级,每一级相当于几个最小可觉差,以及取整到整数像素后的实际步长。

推导

# 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 ratio

在 12–72 像素之间,小二度(1.067)有 28 级,大二度(1.125)15 级,小三度(1.2)10 级,纯四度(1.333)7 级,纯五度与黄金比各 4 级;级数约为 ln⁡6/ln⁡r=1.792/ln⁡r\ln 6/\ln r = 1.792/\ln r。每一级相当于几个最小可觉差,取决于假设的韦伯分数:韦伯分数为 0.06 时,小二度每级只有 1.1 个最小可觉差,相邻两级勉强可分;小三度为 3.1 个,黄金比为 8.3 个。取整到整数像素还会让小比例的步长不均匀:小二度的实际步长在 4.2% 到 10.5% 之间,27 步中有 7 步小于 6%;大二度为 7.7% 到 15.0%,小三度为 17.9% 到 23.1%。

结论是一个取舍,而不是一个定律:比例越大,层级越分明,但可用的级数越少;比例越小,级数越多,但相邻级可能分不清,整数取整还会放大不均匀。韦伯定律只告诉我们比例不能太小,不能选出最优比例。

伯克霍夫的审美度量

数学家伯克霍夫 1933 年的《审美度量》提出,审美价值可以写成「秩序」与「复杂度」之比 M=O/CM = O/C (Birkhoff 1933)。他对多边形、花瓶、旋律与诗歌分别给出了具体的计分方法。对多边形,CC 是承载各边的不同直线的数目,O=V+E+R+HV−FO = V + E + R + HV – F:VV 为竖直对称(0 或 1),EE 为平衡(−1、0 或 1),RR 为旋转对称(按旋转阶数计分),HVHV 为与水平—竖直网格的关系(0、1 或 2),FF 为「不令人满意的形式」的扣分 (Douchová 2015)。

推导

# 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)

A 部分按这一定义计算了三种多边形:正方形 M=6/4=1.50M = 6/4 = 1.50,一般比例的长方形 5/4=1.255/4 = 1.25,底边朝下的正三角形 3.5/3=1.173.5/3 = 1.17。第二行是本章与第一章的连接点:伯克霍夫的度量对一般比例的长方形给出同一个分数,它不能区分黄金长方形与其他长方形,而且给正方形更高的分数。(据道霍娃的转述,伯克霍夫的「不令人满意的形式」项 FF 在顶点间最小距离小于最大距离的十分之一时扣分;对长方形,这相当于长宽比超过 99≈9.95\sqrt{99} \approx 9.95,此时 MM 降为 1.0。该项中「不规则」一款是否会惩罚接近正方形的长方形,原文转述不清,本书不作判断 (Douchová 2015)。)所以,即使接受伯克霍夫的框架,也推不出「黄金比最美」。伯克霍夫的公式提出后受到许多批评,常见的一点是各项计分规则由他凭直觉规定;它与实验测得的偏好之间的关系本书没有系统核对,这里不展开。

复杂度:从柯尔莫哥洛夫到压缩长度

伯克霍夫的 CC 是为每类对象专门规定的。一个更一般的复杂度概念是柯尔莫哥洛夫复杂度 K(x)K(x):能输出字符串 xx 的最短程序的长度。它在理论上很优雅,但不可计算:不存在一个算法能对任意 xx 求出 K(x)K(x) (Li and Vitányi 2008)。不过,任何无损压缩器都给出一个上界:K(x)≤|compress(x)|+O(1)K(x) \le |\mathrm{compress}(x)| + O(1),其中常数是解压程序的长度。所以压缩长度可以作为复杂度的上界代理,但不能当作复杂度本身——压缩器发现不了的规律(例如一段由简单伪随机数生成器产生的「噪声」),压缩长度会严重高估。

程序 B 部分用 zlib 压缩五种 96×64 的二值布局(原始 768 字节)。空白页压缩到 15 字节(其中 6 字节是 zlib 的封装:2 字节头加 4 字节 Adler-32 校验和;空输入压缩后也要 8 字节),严格网格 35 字节,网格加文字行 51 字节,加上随机错位后 125 字节,30% 墨量的随机噪声 749 字节(压缩比 0.98,约 0.975 比特/像素,仍比香农熵的界 H(0.3)=0.881H(0.3) = 0.881 比特/像素高约 11%:zlib 对无结构的噪声几乎无法压缩)。这个顺序符合直觉:错位让布局失去了重复性,压缩长度增加了一倍多。

证据

视觉复杂度与第一印象(摘要)。 东德里 2006 年的综述讨论了视觉复杂度的各种度量,包括图像文件的压缩长度与主观复杂度评分的关系 (Donderi 2006)。林德高等 2006 年做了三项研究:第一项 22 名学生看 100 个主页各 500 毫秒并两次评分,两次评分的一致性很高;第三项 40 名被试随机分为 50 毫秒与 500 毫秒两组,看同样的 50 个主页,两组平均评分的相关为 0.947(第一轮)与 0.953(第二轮),但 50 毫秒组评分者之间的一致性较低(平均 r 约 0.34–0.40,500 毫秒组约 0.56–0.60)(Lindgaard et al. 2006)。图赫等 2012 年用 119 个网站截图,发现视觉复杂度与原型性在 50 毫秒内就影响审美评分,在 17 毫秒时复杂度与原型性仍都有影响,但原型性的影响较弱;复杂度低、原型性高的网站评分最高 (Tuch et al. 2012)。赖内克等 2013 年收集 548 名志愿者对 450 个网站的评分,用计算得到的复杂度与色彩度加上人口特征,解释了 500 毫秒观看后吸引力评分约一半的方差 (Reinecke et al. 2013)。加工流畅性理论认为,容易加工的刺激被体验为更美 (Reber et al. 2004),可以解释「低复杂度、高原型性」的优势,但它是一种解释框架,不是一个可以直接计算的公式。

这些研究的共同点是:它们测量的是几百毫秒内的审美评分,不是购买、注册或任何行为结局。「50 毫秒形成第一印象」是对林德高等研究的合理概括,但不能进一步推成「50 毫秒决定转化」。其次,「复杂度越低越好」也不是线性的:图赫等的结果是复杂度与原型性共同起作用,一个过于空旷、不符合用户对某类网站预期的页面,未必得到高分。

假说 · 尚未验证 · 压缩长度与第一印象

作者的假说(尚未确立): 对同一类网站(例如电商首页)的截图,按灰度化后的 PNG 压缩长度排序,压缩长度处于中等的页面在 500 毫秒审美评分上高于压缩长度最低与最高的页面(倒 U 形)。什么样的结果能证明它是错的: 在事先登记的评分研究中,压缩长度的二次项系数的置信区间包含零或为正,或者评分随压缩长度单调变化。

本章小结

模块化字号比例是设计惯例:韦伯定律只要求比例超过一个阈值,不能选出最优比例;比例的选择是层级清晰度与级数之间的取舍,整数取整还会让小比例的步长不均匀。伯克霍夫的 M=O/CM = O/C 对一般比例(不过分细长)的长方形给出同一分数 1.25,正方形更高(1.50),所以推不出黄金比的特殊地位。柯尔莫哥洛夫复杂度不可计算,压缩长度只是上界代理。视觉复杂度与原型性在几十毫秒内影响审美评分(林德高等 2006、图赫等 2012、赖内克等 2013),但这些研究测量的是短时评分,不是行为结局。

参考文献

Birkhoff, George D. 1933. Aesthetic Measure. Harvard University Press.
Donderi, Don C. 2006. “Visual Complexity: A Review.” Psychological Bulletin 132 (1): 73–97.
Douchová, V. 2015. “Birkhoff’s Aesthetic Measure.” Acta Universitatis Carolinae Philosophica et Historica: Miscellanea Logica X 2015 (1): 39–53.
Li, Ming, and Paul Vitányi. 2008. An Introduction to Kolmogorov Complexity and Its Applications. 3rd ed. Springer.
Lindgaard, Gitte, Gary Fernandes, Cathy Dudek, and J. Brown. 2006. “Attention Web Designers: You Have 50 Milliseconds to Make a Good First Impression!” Behaviour & Information Technology 25 (2): 115–26. https://doi.org/10.1080/01449290500330448.
Reber, Rolf, Norbert Schwarz, and Piotr Winkielman. 2004. “Processing Fluency and Aesthetic Pleasure: Is Beauty in the Perceiver’s Processing Experience?” Personality and Social Psychology Review 8 (4): 364–82.
Reinecke, Katharina, Tom Yeh, Luke Miratrix, et al. 2013. “Predicting Users’ First Impressions of Website Aesthetics with a Quantification of Perceived Visual Complexity and Colorfulness.” Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (CHI ’13), 2049–58.
Tuch, Alexandre N., Eva E. Presslaber, Markus Stöcklin, Klaus Opwis, and Javier A. Bargas-Avila. 2012. “The Role of Visual Complexity and Prototypicality Regarding First Impression of Websites: Working towards Understanding Aesthetic Judgments.” International Journal of Human-Computer Studies 70 (11): 794–811.

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).