This outline is also available in PDF.
Held: Monday, 14 September 2009
We consider the basics of raster graphics, a common technique
for describing and representing images. We also consider
RGB colors, one of the most common mechanisms for
representing colors digitally.
- Quiz 2 returned. We'll run the code for part two to see what was expected.
- I have not yet graded assignment 2 or writeup 1. Sorry.
- Are there questions on writeup 2? or assignment 3?
- We're hoping to distribute exam 1 on Wednesday. It will be due the following Wednesday. You will not have another weekly assignment due next Wednesday. (You will still have a quiz on Friday and may get a lab writeup somewhere in the middle there.)
- We're going to try something a little different today. I'll take questions about the readings today, but won't lecture first.
- Tomorrow, we learn more about colors, but from a very different perspective. Matt Kluber from art will be lecturing.
- Representing images, revisited.
- Pixels and colors: The basics.
- RGB colors.
- Those weird numbers.
- Many ways to represent colors, too.
- Goals: Unambiguous, fast to process, compact
- The color names we've been using are
- Slow to process
- The most common internal representation of colors on computers.
- We think of a color as the combination of three
primaries: red, green, and blue.
- These are the primaries for the so-called additive colors
- You are probably used to the primaries being red, yellow, and blue,
but those are the subtractive colors
- On computers, we represent each component as a number between 0 and 255,
- It turns out that you can shove four numbers, each between 0 and 255,
into the internal representation of an integer.
- So, the red, green, and blue components are three of those numbers.
- What's the forth? In multi-layer images, it's the alpha channel.
- We use
rgb-new to create these colors.
- We use
rgb-blue to extract the corresponding components.
- We're representing colors as three integers, each in the range
- Yet when we ask MediaScript for a color, we tend to get a single integer
which is rarely in that range?
- What's giong on?
- Well, most computers have different techniques for representing really
small integers (particularly integers in the range [0..255]) and
standard-length integers. We're using the smaller representation,
but shoving three of those into a standard-length integer.
- We use that representation because it makes everything faster.
- Even those of us who designed that representation can't read it.