Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

image gradient

An arrow at each pixel pointing toward the direction brightness increases fastest, sized by how fast it increases.

For an image treated as a function f(x,y) of brightness, the gradient \nabla f = (\partial f/\partial x,\ \partial f/\partial y) is a vector at each pixel: its direction points toward the steepest increase in brightness, and its magnitude \|\nabla f\| = \sqrt{(\partial f/\partial x)^2+(\partial f/\partial y)^2} measures how steep that increase is. A large gradient magnitude marks an edge; the gradient's direction is what corner and keypoint detectors (Chapter 4) and gradient histograms (Section 4.3) build on.

Examples

  • Inside a flat, solid-colored region the gradient is nearly the zero vector everywhere; crossing a sharp light-to-dark boundary produces a large-magnitude gradient pointing across the boundary.

Read the full section →
Graph settings

Calculator