1 raster

Grid of pixels

1.1 raster graphics

1.2 vector graphics

1.3 color function

Mapping colors of individual pixels of an image through a function: C_{out} = f(C_{in})

1.4 convolution filters

Mapping colors of a matrix of pixels of an image through a kernel.

I'_{x, y} = I_{off} + \frac{\sum_i \sum_j M_{i, j} \cdot I_{x+i, y+j}}{D}

Where M_{0,0} is the anchor of the kernel.

1.4.1 edge cases

1.4.1.1 kernel on the edge of the image

1.4.1.2 color values out of range

1.4.2 filters

1.4.2.1 blur

\begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}

1.4.2.2 gaussian smoothing

G(x,y) = \frac{1}{2 \pi \sigma^2} \exp{(-\frac{x^2 + y^2}{2\sigma^2})}

\begin{bmatrix} 0 & 1 & 0 \\ 1 & 4 & 1 \\ 0 & 1 & 0 \\ \end{bmatrix}

1.4.2.3 sharpen filter

\begin{bmatrix} 0 & -\frac{a}{s} & 0 \\ -\frac{a}{s} & \frac{b}{s} & -\frac{a}{s} \\ 0 & -\frac{a}{s} & 0 \\ \end{bmatrix}

Where s = b - 4a

1.4.2.3.1 mean removal

\begin{bmatrix} -1 & -1 & -1 \\ -1 & 9 & -1 \\ -1 & -1 & -1 \\ \end{bmatrix}

1.4.2.4 horizontal edge detection

\begin{bmatrix} 0 & -1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix}

1.4.2.5 vertical edge detection

\begin{bmatrix} 0 & 0 & 0 \\ -1 & 1 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix}

1.4.2.6 diagonal edge detection

\begin{bmatrix} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix}

1.4.2.6.1 laplacian edge detection

\begin{bmatrix} 0 & -1 & 0 \\ -1 & 4 & -1 \\ 0 & -1 & 0 \\ \end{bmatrix}

\begin{bmatrix} -1 & -1 & -1 \\ -1 & 8 & -1 \\ -1 & -1 & -1 \\ \end{bmatrix}

1.4.2.7 emboss

\begin{bmatrix} -1 & 0 & 1 \\ -1 & 1 & 1 \\ -1 & 0 & 1 \\ \end{bmatrix}

1.5 achromatic light

Described only by intensity:

1.5.1 Weber-Fechner law

p = k \ln \frac{Y}{Y_0}

where p - perceived brightness, Y - luminance, Y_0 - threshold luminance

1.5.1.1 contrast ratio

Ratio of luminous intensity of the brightest and darkest possible point on the screen (Y_0 : 1)

Typical LCD displays have between 400:1 and 2000:1

1.5.2 mach bands

Intensity at the vicinity of an edge is overestimated for light values and underestimated for dark values

1.5.3 halftoning

Printing using dots of ink

1.5.3.1 CMYK

Cyan Magenta Yellow (K)Black

Each rotated to not overlap:

1.6 dithering

Impression of multiple levels of gray on a device capable of displaying limited number of levels

1.6.1 ordered dithering

Example dither matrices:

D_2 = \begin{bmatrix} 1 & 3 \\ 4 & 2 \\ \end{bmatrix}

D_3 = \begin{bmatrix} 3 & 7 & 4 \\ 6 & 1 & 9 \\ 2 & 8 & 5 \\ \end{bmatrix}

1.6.1.1 Bayer matrix

B_n = \frac{1}{n^2 + 1}D_n

1.6.2 error diffusion

Error being the difference between the approximated pixel value and the real value is distributed to neighboring pixels. So a weighted error diffusion can be applied, which modifies the pixels which will be processed next:

\begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & \frac{7}{16} \\ \frac{3}{16} & \frac{5}{16} & \frac{1}{16} \\ \end{bmatrix}