Class10

From MathWiki

I said that I have 3 more classes left. Since this is the 10th class, we only have one more left...oops.

Here is the 9th assignment. Media:Ass9.pdf

The person who was responsible for taking notes this night dropped the course so there won't be anyone to do it.

We mostly went over assignment 9 which was to take an image an reduce the colors. We will want to do this for creating a photo mosaic.

If you are reducing the colors in an image from 256 x 256 x 256 RGB color cube to a 4 x 4 x 4 color cube where the color values are {0,85,170,255}

There are two possible functions you might consider

\begin{cases} 0 &\hbox{ if } 0 \leq c \leq 63\\ 85 &\hbox{ if } 64 \leq c \leq 127\\ 170 &\hbox{ if } 128 \leq c \leq 191\\ 255 &\hbox{ if } 192 \leq c \leq 255 \end{cases}

\begin{cases} 0 &\hbox{ if } 0 \leq c \leq 42\\ 85 &\hbox{ if } 43 \leq c \leq 127\\ 170 &\hbox{ if } 128 \leq c \leq 212\\ 255 &\hbox{ if } 213 \leq c \leq 255 \end{cases}

These can be represented by if-then-else statements, but it is much easier to express them in terms of floor()

The first one is floor(c / 64) * 85

The second one is floor((c + 42) / 85) * 85