Image contrast (source code)

= Image contrast

<Image contrast> measures how distinguishable image intensities are under a stated definition. For a periodic bright-dark pattern, <Michelson contrast> is $(I_{\max}-I_{\min})/(I_{\max}+I_{\min})$. For a small feature on a uniform background, a relative difference from that background is often more informative.

A high-contrast image can still have poor <spatial resolution>, and a finely resolved feature can be difficult to detect if noise masks its intensity difference. Illumination, background, optical blur, detector response and display scaling all affect measured contrast. Choosing a formula should follow the imaging task.