MAunit-2 Notes
MAunit-2 Notes
Basics of Color
where E is the light (spectral power distribution) and S are the spectral sensitivity functions.
A color can be specified as the sum of three colors. So colors form a 3 dimensional vector space.
The following figure shows the amounts of three primaries needed to match all the wavelengths of the
visible spectrum.
The negative value indicates that some colors cannot be exactly produced by adding up the primaries.
CIE Chromaticity Diagram
Q: Does a set of primaries exist that span the space with only positive coefficients?
A: Yes, but no pure colors.
In 1931, the CIE (Commission Internationale de L'Eclairage, or International Commission on Illumination)
defined three standard primaries (X, Y, Z). The Y primary was intentionally chosen to be identical to the
luminous-efficiency function of human eyes.
The above figure shows the amounts of X, Y, Z needed to exactly reproduce any visible color.
All visible colors are in a "horseshoe" shaped cone in the X-Y-Z space. Consider the plane X+Y+Z=1 and project
it onto the X-Y plane, we get the CIE chromaticity diagram as below.
The edges represent the "pure" colors (sine waves at the appropriate frequency)
White (a blackbody radiating at 6447 kelvin) is at the "dot"
When added, any two colors (points on the CIE diagram) produce a point on the line between them.
Q: how can we find a color's complement on the CIE diagram?
L*a*b (Lab) Color Model
Color Models
A color image is a 2-D array of (R,G,B) integer triplets. These triplets encode how much the corresponding phosphor
should be excited in devices such as a monitor.
Sometimes, an alternative CMYK model (K stands for Black) is used in color printing (e.g., to produce
darker black than simply mixing CMY).
o K := min (C, M, Y), C := C - K, M := M - K, Y := Y - K.
Comparison of Three Color Gamuts
The gamut of colors is all colors that can be reproduced using the three primaries
The Lab gamut covers all colors in visible spectrum
The RGB gamut is smaller, hence certain visible colors (e.g. pure yellow, pure cyan) cannot be seen on monitors
The CMYK gamut is the smallest (but not a straight subset of the RGB gamut)
3.3.3. Color Models in Video
YIQ and YUV are the two commonly used color models in video
YUV Color Model
Initially, for PAL analog video, it is now also used in CCIR 601 standard for digital video
Y (luminance) is the CIE Y primary.
Y = 0.299R + 0.587G + 0.114B
Chrominance is defined as the difference between a color and a reference white at the same luminance. It can
be represented by U and V -- the color differences.
U=B-Y
V=R-Y
o If b/w image, then U = V = 0. --> No chrominance!
o ** In actual PAL implementation:
U = 0.492 (B - Y)
V = 0.877 (R - Y)
Sample YUV Decomposition:
Y U V
Eye is most sensitive to Y. In PAL, 5.5 MHz is allocated to Y, 1.8 MHz each to U and V.
YCbCr Color Model
The YCbCr model is closely related to the YUV, it is a scaled and shifted
YUV. Cb = (B - Y) / 1.772 + 0.5
Cr = (R - Y) / 1.402 + 0.5
The chrominance values in YCbCr are always in the range of 0 to 1.
YCbCr is used in JPEG and MPEG.
YIQ Color Model
YIQ is used in NTSC color TV broadcasting, it is downward compatible with B/W TV where only Y is used.
Although U and V nicely define the color differences, they do not align with the desired human perceptual
color sensitivities. In NTSC, I and Q are used instead.
I is the orange-blue axis, Q is the purple-green axis.
I and Q axes are scaled and rotated R - Y and B - Y (by 33 degrees clockwise).
I = 0.877(R - Y) cos 33 - 0.492(B - Y) sin 33
Q = 0.877(R - Y) sin 33 + 0.492(B - Y) cos 33
Namely,
I = 0.736(R - Y) - 0.268(B - Y) = 0.596R - 0.275G - 0.321B
Q = 0.478(R - Y) + 0.413(B - Y) = 0.212R - 0.523G +
0.311B
The YIQ transform:
1. **Text:**
- **HTML (Hypertext Markup Language):** The standard markup language for creating web pages.
2. **Images:**
- **JPEG (Joint Photographic Experts Group):** Widely used for photographic images due to its compression efficiency.
- **PNG (Portable Network Graphics):** Suitable for images with transparency and lossless compression.
- **GIF (Graphics Interchange Format):** Supports animations and simple transparency.
3. **Audio:**
- **MP3 (MPEG Audio Layer III):** A popular compressed audio format.
- **AAC (Advanced Audio Codec):** Offers better quality than MP3 at similar bit rates.
- **OGG (Ogg Vorbis):** A free, open-source, and lossy audio compression format.
4. **Video:**
- **MP4 (MPEG-4 Part 14):** A versatile video format that supports various codecs.
- **WebM:** An open and royalty-free format designed for the web, supporting VP8 or VP9 video codecs.
- **Ogg Theora:** An open-source and royalty-free video compression format.
5. **Interactive Elements:**
- **JavaScript (JS):** A programming language often used to create interactive web elements.
- **CSS (Cascading Style Sheets):** Used to control the presentation and layout of web pages.
6. **Vector Graphics:**
- **SVG (Scalable Vector Graphics):** XML-based vector image format that is scalable without loss of quality.
7. **3D Graphics:**
- **GLTF (Graphics Library Transmission Format):** An open standard for efficient transmission and loading of 3D
scenes and models.
8. **Document Formats:**
- **PDF (Portable Document Format):** Used for representing documents in a manner independent of application
software, hardware, and operating systems.
- **DOCX (Office Open XML):** Microsoft Word document format.
9. **Font Formats:**
- **WOFF (Web Open Font Format):** A font format developed specifically for the web.
- **TTF/OTF (TrueType/OpenType Font):** Standard font formats that can be used on the web.
It's important to note that the choice of file format depends on the specific requirements of the content, including factors
like quality, file size, and browser compatibility. Additionally, emerging technologies may introduce new file formats or
improvements to existing ones over time.
*****************