This week, we learned about manipulating image colours in Dr. Racket. To better understand colour, my TA gave as a crash course in understanding colour values.
We use
(make-color) in Dr. Racket, to determine colour values and manipulate colour. Color is comprised of
R G B alpha values, alpha determining opaque and transparency.
The following are the standard R G B alpha values for the following colors:
- WHITE 255 255 255 255
- BLACK 0 0 0 255
- RED 255 0 0 255
- GREEN 0 255 0 255
- BLUE 0 0 255 255
Color is applied to images by use of pixels:
pixel
/ˈpɪksəl/
noun
1.
any of a number of very small picture elements that make up a picture, as on a visual display unit
Source: http://dictionary.reference.com/browse/pixel
All images are made up of pixels, which contain different colour values.
For example:
CMOS Image Sensor Chart Found at: http://homepages.nildram.co.uk/~sbuniak/AstroPhotog/Astrophotog%20images/CMOS_Image_Sensor.jpg
And:
Image Source: http://www.sprawls.org/resources/DICHAR/pixelsize.jpg
Pixels also come in different sizes. The size of a pixel, determines its numerical value:
Image Source: http://www.usb.org/cguide/images/px_size.gif
To find out what colours make up your image, type in the following list function in Dr. Racket:
list
(image->color-list an-image)
NOTE: You must substitute "an-image" with the actual image you want to use.
Hope this info was helpful!