JMU
Images/Rasters
An Introduction


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Sampling Static Visual Content
Sampling Static Visual Content (cont.)
Operations
One Simple Operation - "Grayscale"
Another Simple Operation - "Grayscale Except"
Look-Ups
Look-Ups (cont.)

An Example: A Photo Negative

for (int i=0; i<256; i++) 
{
    lookup[i] = (255 - i);
}
Look-Ups (cont.)

An Example: A Night Vision Effect

for (int i=0; i<256; i++) 
{
    lookupR[i] = 0;
    lookupG[i] = i;
    lookupB[i] = 0;
}
Color Space Conversion
Color Space Conversion (cont.)
An Example: RGB \(\leftrightarrow\) HSV

\( \left[ \begin{array}{c c} Y \\ I \\ Q \end{array} \right] = \left[ \begin{array}{r r r} 0.299 & 0.587 & 0.114 \\ 0.596 & -0.275 & -0.321 \\ 0.212 & -0.523 & 0.311 \\ \end{array} \right] \left[ \begin{array}{c c} R \\ G \\ B \end{array} \right] \)

\( \left[ \begin{array}{c c} R \\ G \\ B \end{array} \right] = \left[ \begin{array}{r r r} 1.000 & 0.956 & 0.621 \\ 1.000 & -0.272 & -0.647 \\ 1.000 & -1.105 & 1.702 \\ \end{array} \right] \left[ \begin{array}{c c} Y \\ I \\ Q \end{array} \right] \)

Cropping/Cutting