Source
Base colour
Stimulus Parameters
Spatial frequency (cpd) 4
Temporal frequency (Hz) 2
Contrast (%) 25
Pupil size (mm) 3.0
Channels & CVD
Cortex & Gabor
Gabor orientations 8
RF size (px) 31
Gabor SF (cycles/img) 4
Gabor sigma 6
Retinal Ganglion DoG
Center sigma 1.5
Surround sigma 4.0
Surround weight 0.75
Pipeline Layers
Visualisation
Display Options
Rendered stimulus
Pupil 3.0 mm
Signals — LMS & Opponent traces
L M S L-M S-(L+M) L+M
Cone fundamentals (Stockman-Sharpe 2°)
Cortical activity (heatmap)
Orientation population (mean response)
Spike raster (Poisson)
Activity histogram
Population readouts
Predicted detectability
Best text colour
Contrast RMS
Actions
Pipeline Control
Process triggers the full visual pipeline on the current stimulus/image.
Export
Import Settings
Share
State is encoded in the URL automatically.
Benchmark
Runs the full pipeline 5x and reports average time per iteration.
Visual Neuroscience Standards
Stockman & Sharpe (2000) — Cone Fundamentals

CIE 170-1:2006 2° cone fundamentals. Three cone classes — L (long, ~570 nm peak), M (medium, ~543 nm peak), S (short, ~442 nm peak) — define the first stage of colour vision. The Stockman-Sharpe fundamentals are the internationally accepted standard for cone spectral sensitivity, derived from colour matching experiments with confirmed dichromats.

This tool uses 10-nm sampled fundamentals from 390–730 nm, normalised to unity peak. The Hunt-Pointer-Estevez matrix converts linear sRGB to cone LMS excitations.

DKL Colour Space — Opponent Channels

Derrington, Krauskopf & Lennie (1984): Three post-receptoral opponent mechanisms form the basis of the DKL colour space used in vision research.

  • L-M — Red-green chromatic channel (parvocellular pathway)
  • S-(L+M) — Blue-yellow chromatic channel (koniocellular pathway)
  • L+M — Achromatic luminance channel (magnocellular pathway)
Retinal Ganglion Cells — Center-Surround DoG

Retinal ganglion cells are modelled using a Difference-of-Gaussians (DoG) receptive field. The center is narrow (excitatory), the surround is wide (inhibitory). ON-center cells respond to luminance increments; OFF-center cells respond to decrements.

Contrast Sensitivity Function (CSF)

Watson & Ahumada (2005): The CSF describes the sensitivity of the visual system as a function of spatial frequency, temporal frequency, and retinal illuminance. Sensitivity follows a bandpass shape peaking around 3–5 cpd spatially and 8–10 Hz temporally under photopic conditions.

V1 Simple & Complex Cells — Gabor Model

Hubel & Wiesel (1962); Daugman (1985): V1 simple cells are well-modelled by Gabor filters. Complex cell energy = sum of squared quadrature responses. Divisive normalization (Heeger 1992) controls gain across the population.

V2 Texture Boundaries & V4 Colour Cells

V2: Gradient magnitude of V1 complex energy map detects texture boundaries. V4: Colour-selective neurons tuned to directions in DKL opponent space.

Colour Vision Deficiency (CVD)

Brettel, Vienot & Mollon (1997): CVD simulation using linear transformation matrices in LMS space. Protanopia (L absent), Deuteranopia (M absent), Tritanopia (S absent). Extreme dichromacy only.

Mathematical Models and Formulas
LMS / HPE
Hunt-Pointer-Estevez (HPE) Matrix — linear sRGB → LMS:
|L| | 0.4002 0.7076 -0.0808 | |R_lin|
|M| = |-0.2263 1.1653 0.0457 | |G_lin|
|S| | 0.0000 0.0000 0.9182 | |B_lin|

sRGB EOTF (IEC 61966-2-1):
V ≤ 0.04045: L = V/12.92
V > 0.04045: L = ((V+0.055)/1.055)^2.4

Relative luminance:
Y = 0.2126·R_lin + 0.7152·G_lin + 0.0722·B_lin
Opponent
Opponent channels (DKL approximation):
RG = L − M (red-green, parvo)
BY = S − 0.5(L + M) (blue-yellow, konio)
Lum = L + M (achromatic, magno)

CVD simulation (Brettel 1997 matrices):
Protanopia: [0.000 1.051 -0.051; 0 1 0; 0 0 1]
Deuteranopia:[1 0 0; 0.951 0.000 0.049; 0 0 1]
Tritanopia: [1 0 0; 0 1 0; -0.867 1.867 0.000]
Applied in linear RGB → LMS → modified LMS → RGB
DoG / Ganglion
Difference-of-Gaussians (DoG) receptive field:
DoG(x,y) = G(x,y; σ_c) − w · G(x,y; σ_s)
G(x,y; σ) = exp(−(x²+y²) / (2σ²))

σ_c = center sigma (narrow, excitatory)
σ_s = surround sigma (wide, inhibitory)
w = surround weight (relative gain)

ON-center: response = max(DoG * lum, 0)
OFF-center: response = max(−DoG * lum, 0)

Kernel is zero-mean normalised before convolution.
Gabor / V1
Gabor filter (V1 simple cell model):
G(x,y; θ,f,σ,φ) = exp(−(x'²+y'²)/(2σ²)) · cos(2πf·x' + φ)
x' = x·cos(θ) + y·sin(θ)
y' = −x·sin(θ) + y·cos(θ)

Complex cell energy (quadrature pair):
E = √(even² + odd²), even: φ=0, odd: φ=π/2

Divisive normalisation (Heeger 1992):
R_norm = R / (σ_pool · G_blur(R) + ε)

Hypercolumn preferred orientation:
θ_pref = argmax_o { E_o(x,y) }
Selectivity = E_best / Σ E_all
CSF
Contrast Sensitivity Function (Watson-Ahumada approx):
area = π · (pupil/2)²
retIllu ∝ area (trolands proxy)
f_peak = 3.0 + 0.2 · retIllu

S_spatial = exp(−0.5 · (log(spf/f_peak)/bw)²)
S_temporal = exp(−0.5 · ((tf−8)/6)²)

CSF = clamp01(S_spatial · S_temporal)

Predicted detectability ≈ CSF × 100%
Limitations
  • Educational Approximation: These models are simplified for interactive exploration.
  • No Temporal Dynamics: The pipeline processes static images. Temporal frequency affects stimulus generation and CSF but not retinal adaptation.
  • 2D Only: No depth, binocular disparity, or 3D scene understanding.
  • Fixed Cone Sampling: Uniform cone mosaic — no foveal density gradient.
  • No Chromatic Aberration: Eye's LCA is not modelled.
  • No Adaptation: No Von Kries adaptation, dark/light adaptation, or after-images.
  • CPU Processing: All convolutions on CPU. Large images or many orientations may be slow.
Research, Standards and Citations

Cone Fundamentals & Opponent Theory

[1] Stockman, A. & Sharpe, L.T. (2000). The spectral sensitivities of the middle- and long-wavelength-sensitive cones derived from measurements in observers of known genotype. Vision Research, 40(13), 1711–1737.

[2] Derrington, A.M., Krauskopf, J. & Lennie, P. (1984). Chromatic mechanisms in lateral geniculate nucleus of macaque. Journal of Physiology, 357, 241–265.

[3] De Valois, R.L. & De Valois, K.K. (1993). A multi-stage color model. Vision Research, 33(8), 1053–1065.

[4] Hunt, R.W.G. (2004). The Reproduction of Colour, 6th ed. Wiley.

Contrast Sensitivity & Spatial Vision

[5] Campbell, F.W. & Robson, J.G. (1968). Application of Fourier analysis to the visibility of gratings. Journal of Physiology, 197(3), 551–566.

[6] Watson, A.B. & Ahumada, A.J. (2005). A standard model for foveal detection of spatial contrast. Journal of Vision, 5(9), 717–740.

[7] Wyszecki, G. & Stiles, W.S. (1982). Color Science, 2nd ed. Wiley.

Retinal & Cortical Models

[8] Hubel, D.H. & Wiesel, T.N. (1962). Receptive fields, binocular interaction and functional architecture in the cat's visual cortex. Journal of Physiology, 160(1), 106–154.

[9] Daugman, J.G. (1985). Uncertainty relation for resolution in space, spatial frequency, and orientation optimized by two-dimensional visual cortical filters. JOSA A, 2(7), 1160–1169.

[10] Heeger, D.J. (1992). Normalization of cell responses in cat striate cortex. Visual Neuroscience, 9(2), 181–197.

[11] Rodieck, R.W. (1965). Quantitative analysis of cat retinal ganglion cell response to visual stimuli. Vision Research, 5(11), 583–601.

Colour Vision Deficiency

[12] Brettel, H., Vienot, F. & Mollon, J.D. (1997). Computerized simulation of color appearance for dichromats. JOSA A, 14(10), 2647–2655.

[13] Machado, G.M., Oliveira, M.M. & Fernandes, L.A.F. (2009). A physiologically-based model for simulation of color vision deficiency. IEEE TVCG, 15(6), 1291–1298.

About this tool

This tool implements a simplified visual pipeline from retina through cortex with cone spectral sensitivity, CSF-based detectability, CVD simulation, spike raster and population analysis — entirely client-side. Educational approximation — not a substitute for clinical or psychophysical testing.

Research & Visualization
Batch Colour Analysis

Enter hex colours (one per line or comma-separated). Computes LMS cone excitations, opponent channel values, and CSF-based detectability for each colour at the current stimulus parameters.

Click Run Batch to analyse colours.
Visual Pipeline Stages
1. sRGB EOTF — Linearise input (IEC 61966-2-1)
2. HPE Matrix — Convert linear RGB → LMS cone excitations
3. Opponent Channels — L-M (parvo), S-(L+M) (konio), L+M (magno)
4. Retinal Ganglion DoG — Center-surround spatial filtering (ON/OFF cells)
5. LGN Relay — Opponent signal segregation (parvo/konio/magnocellular)
6. V1 Simple Cells — Gabor filter bank (N orientations × quadrature pairs)
7. V1 Complex Cells — Quadrature energy √(even² + odd²)
8. Divisive Normalisation — Population gain control (Heeger 1992)
9. Hypercolumn Map — Preferred orientation per pixel (argmax energy)
10. V2 Texture Boundary — Gradient of V1 energy → texture edges
11. V4 Colour Selectivity — Opponent direction dot product → colour neurons
12. Spike Raster — Poisson sampling of population activity
Parallel Visual Pathways
Parvo High spatial acuity, low temporal resolution. Carries L-M (red-green) chromatic and fine spatial detail. ~80% of retinal ganglion cells.
Konio S-(L+M) blue-yellow pathway. Small population (~10%). Projects to cytochrome oxidase blobs in V1.
Magno Achromatic luminance channel. High temporal sensitivity, low spatial resolution. Motion, flicker, depth.
Research backend provides: LMS cone responses (Stockman-Sharpe 2°), DKL opponent channels, retinal ganglion DoG, LGN pathway segregation, V1 Gabor bank with quadrature energy and divisive normalisation, V1 hypercolumn orientation maps, V2 texture boundary detection, V4 colour-selective neurons (6 presets), spike raster with Poisson noise, population histogram, CSF-based detectability, CVD simulation, batch analysis, pipeline benchmark, JSON import/export, URL state sync. All on-device, zero network.