Generative Typography / ASCII
単一の起源作品はない。画像を文字グリッドで表す手法は、初期のタイプライター/ テレタイプによる「タイプ・アート」や1960〜70年代のコンピュータのテキストモード グラフィックスに遡り、コーディング・コミュニティの散在的な実践(例:ertdfgcvb の ブラウザ・プレイグラウンド)として続いている。年代を特定できる「最初」ではなく、 根が分散した手法。
コミュニティ・通称 名称 — 命名・エポニムではなく記述的なカテゴリ名。用語の単一の命名者は確認されていない。
ひとことで 文字や ASCII グリフを画像化する手法。タイポグラフィのアレンジでも使われる。
コード
上のデモの実際のスケッチ(サンドボックスで再現可能)。これで全部です。
ascii-art/index.html
const SEED = Math.floor(Math.random()*1e9);
// Render a procedural light field (overlapping radial gradients) then map
// brightness to an ASCII glyph ramp — generative ASCII art.
const RAMP = " .:-=+*#%@";
function setup() {
randomSeed(SEED); noiseSeed(SEED);
const s = Math.min(windowWidth, windowHeight);
createCanvas(s, s);
background(10, 13, 16);
textFont('monospace');
textAlign(CENTER, CENTER);
const COLS = 70;
const cw = s / COLS;
const rows = Math.floor(s / cw);
textSize(cw * 1.15);
// light sources
const lights = [];
const n = 3 + Math.floor(random(3));
for (let i = 0; i < n; i++) lights.push({ x: random(s), y: random(s), r: random(s*0.2, s*0.45) });
const hueBase = random(360);
colorMode(HSB, 360, 100, 100);
for (let j = 0; j < rows; j++) {
for (let i = 0; i < COLS; i++) {
const x = i*cw + cw/2, y = j*cw + cw/2;
let b = 0;
for (const L of lights) {
const d = Math.hypot(x-L.x, y-L.y);
b += Math.max(0, 1 - d / L.r);
}
b = Math.min(1, b) * (0.7 + 0.3*noise(i*0.2, j*0.2));
const ch = RAMP[Math.min(RAMP.length-1, Math.floor(b * RAMP.length))];
if (ch === ' ') continue;
fill((hueBase + b*80) % 360, 55, 40 + b*60);
text(ch, x, y);
}
}
}仕組み
画像に文字セルのグリッドを敷く(その解像度が作品の「画素」)。各セルで:(1) セル内の明度を平均、(2) インク被覆率順のランプ(例:明→暗 " .:-=+*#%@")の字に対応づけ、暗いセルほど密な文字にする、(3) 任意で明度の代わりにセルの勾配/エッジを線状グリフ(/ \ | _)に合わせてエッジ追従にし、各文字を着色して色を加える。同じセル単位規則を毎フレーム走らせるため、ライブ入力や時間変化する関数(ertdfgcvb のプレイグラウンド等)を与えると文字画像がアニメートする。
パラメータ
charSet: array — Glyphs ordered by visual density, mapped from light to dark.cellSize: number — Pixel block each character represents.sourceMapping: string — What drives the glyph choice (image brightness, noise, a 3D scene).fontSize: number — Type size the characters are drawn at.
系譜
よく組み合わされるアルゴリズム
- 3D Mesh / Geometry · 1 作品
- Generative Typography · 1 作品
- HSL / Hue Cycle · 1 作品
- Particle System · 1 作品
このアルゴリズムを使う作品 (4)
最終更新 2026-07-16