FFT 2D Visualizer
Draw or upload an image and visualize its 2D Fast Fourier Transform magnitude spectrum. Adjustable log base, power, offset, and scale. Uses fft.js.
v0.0.1
π°
π
π
FFT 2D Visualizer
Source
equation uses draw
Loading editorβ¦
Variables
Functions
Snippets
FFT
Log-scale remap is on β weaker frequencies are lifted into view.
display = normalize(log2(scale Γ (magnitude + offset)3))
Auto
Documentation
FFT 2D Visualizer
Write a safe pixel equation and see its 2D Fast Fourier Transform magnitude spectrum in real time. OR freehand draw explicitly in your equation.
Features
- Live equation editor (Acorn-parsed mini-language β no
eval) - Presets: checkerboard, circle, wave, cross, persian tile, sinusoidal, image
- Per-pixel vars:
img(uploaded image),draw(freehand strokes) - Upload an image β stored as
img(0β255 grayscale) in the equation - Freehand draw β stored as
draw; combine with|| draw > 0ormax(..., draw) - Revamp toggle for log-scale spectrum display
- Touch and mouse support
Equation language
Safe mini-language: const, return, if/else, builtins (sin, floor, xor, maxβ¦). Per-pixel vars: x, y, px, py, img, draw (0β255).
Return a number (β1β¦1 β grayscale, 0β¦255 as-is) or boolean (on/off). Combine drawing explicitly, e.g. || draw > 0 or max(wave, draw).
Dependencies
pnpm add fft.js acorn @codemirror/state @codemirror/view @codemirror/commands @codemirror/language @codemirror/lang-javascriptLanguage: bash