1 / 17

CS 101 – Sept. 16

CS 101 – Sept. 16. Finish color representation RGB √ CMY HSB Indexed color Chapter 4 – how computers think Begin with basic building blocks. Color rep’ns. RGB – system based on light CMY – based on printing HSB – based on art Indexed color – a swatch to save space. RGB system.

frieda
Download Presentation

CS 101 – Sept. 16

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 101 – Sept. 16 • Finish color representation • RGB √ • CMY • HSB • Indexed color • Chapter 4 – how computers think • Begin with basic building blocks

  2. Color rep’ns • RGB – system based on light • CMY – based on printing • HSB – based on art • Indexed color – a swatch to save space

  3. RGB system • Based on primary colors for light • Each pixel has (red, green, blue) values. • Examples black = (0, 0, 0) purple = (75, 0, 100) white = (255, 255, 255) • How about (x, x, x) or (0, 0, x) ?

  4. RGB examples

  5. CMY system • Based on primary colors of printing • Each pixel has (cyan, magenta, yellow) values • In contrast to RGB: white = (0, 0, 0) black = (255, 255, 255)

  6. CMY examples

  7. Practical notes • Printout may look different to screen • Ex. RGB blue = (0, 0, 255) but CMY blue = (255, 255, 0) In other words, in color printer, 2 different toners required to produce blue. • CMY, a.k.a. CMYK

  8. HSB system • From artistic standpoint, neither RGB nor CMY makes much sense to people  • More intuitive color definition: • Hue = what color you want • Saturation = how much of that color • Brightness

  9. Hue = which direction on color wheel Saturation = how far from center Brightness = how far up or down HSB geometry

  10. brightness Trade-off between saturation and brightness hue saturation

  11. Indexed color • Do we really need 16,777,216 colors? • ~ 200 is more practical • Indexed color is like RGB: • 6 values of each primary color, not 256 • Hex values: 00, 33, 66, 99, cc, ff • 1 byte per pixel instead of 3 • Dithering to simulate in-between colors

  12. Chapter 4 Begin chapter on computer organization • Logic gates • Used to perform math operations • Later: finite automata • basic model of computation

  13. Basic building blocks Usually 2 inputs X, Y could be 0 or 1. 1 = true 0 = false By combining 2+ gates, you get more sophisticated functions Logic Gates

  14. ‘AND’ and ‘OR’

  15. Adder • We can teach the computer how to add using just a few logic gates. • However, we need to look at one more gate, the XOR.

  16. XOR basically says “either, but not both” The output is 1 if both inputs are different. Exclusive or (XOR)

  17. Adder • Here is the logic to add, one bit at a time.

More Related