1. Gyanastra
  2. Computer Graphics
  3. Display Devices, Colour, Images and Fractals
  4. Color Models Animation and Fractals
Free lesson, no account needed 10 min read 8 practice questions after it
Asked in past papers4 times
  • ISRO2013
  • UGC NET201420132012

Computer Graphics · Display Devices, Colour, Images and Fractals

Color Models Animation and Fractals

Overview

Colour models specify colours numerically so that displays, printers and users can create and convert colours consistently.
Animation creates the illusion of motion by generating a sequence of frames and updating object properties frame by frame.
Fractals are self-similar or recursively generated shapes, including escape-time complex sets such as the Mandelbrot and Julia sets.
In UGC NET Computer Graphics, this topic is asked through definitions, acronym expansions, colour conversions, animation terminology, output-primitive attributes and complex-iteration facts.
Before studying it, know basic coordinate geometry, vector subtraction, recursion/iteration and the meaning of a frame in a moving picture.

Key concepts

  • A colour model represents a colour as a tuple, usually three numbers. A colour gamut is the range of colours a device can reproduce.
  • RGB means Red, Green, Blue. It is an additive model: primaries add light. Normalized values lie in [0,1][0,1]; 8-bit values lie in 00–255255. Black is (0,0,0)(0,0,0), white is (1,1,1)(1,1,1). Used in displays.
  • CMY means Cyan, Magenta, Yellow. It is a subtractive model: inks subtract light from white paper. In normalized form, zero ink gives white and full ink gives black. Used in printing.
    CMYK adds black KK to save ink and improve dark tones.
  • RGB and CMY are three-primary colour models. HSV and HLS/HSL are not three-primary models; they describe colour by hue, saturation and a brightness-like component.
  • HSV means Hue, Saturation, Value. Hue is an angle, usually 0∘0^\circ–360∘360^\circ; saturation and value are usually 00–11. Value is the maximum of R,G,BR,G,B.
  • HLS means Hue, Lightness, Saturation in the UGC convention. The same model is also called HSL with the order Hue, Saturation, Lightness. Lightness 00 is black, lightness 11 is white, and zero saturation is gray.
  • Animation is a sequence of frames displayed over time. A key frame stores an important pose; in-between frames or tween frames are generated between key frames.
  • An actor in animation is a small program or procedure invoked exactly once per frame to determine the characteristics of some object in the animation.
  • Standard animation-language categories are linear-list notations, general-purpose languages, and graphical languages. All three are valid categories.
  • Output primitive attributes: line uses type, width, colour; fill area uses style, colour, pattern; text uses colour, size, font; marker uses type, size, colour.
  • A fractal has self-similarity and detail at many scales, often with non-integer dimension. Mandelbrot set uses zn+1=zn2+cz_{n+1}=z_n^2+c with z0=0z_0=0 and varies complex cc. Julia set fixes cc and varies the starting complex value z0z_0.
  • In the Mandelbrot construction, both the iterated value and the parameter are complex numbers. If written as xn+1=xn2+zx_{n+1}=x_n^2+z, then both xnx_n and zz are complex.

How it works

  1. Choose the colour model by purpose. Displays use RGB, printers use CMY/CMYK, and artistic colour selection often uses HSV or HLS.
  2. Convert RGB and CMY using complements. For normalized values, each CMY component is one minus the corresponding RGB component. Reverse the subtraction to go from CMY to RGB. For 8-bit values, subtract from 255255 instead of 11.
  3. Convert RGB to HSV. Find the maximum and minimum of R,G,BR,G,B. Value is the maximum, saturation is range divided by maximum, and hue is calculated from which primary is maximum.
    If the maximum and minimum are equal, the colour is gray and hue is set to 0∘0^\circ.
  4. Animate frame by frame. Define key frames or a script. At each frame, call the actor once, compute position, colour, shape or other object characteristics, render the frame, then advance to the next frame.
  5. Classify animation languages. Linear-list notations list actions/events in sequence or with times; general-purpose languages use ordinary programming constructs with graphics routines; graphical languages use diagrams, icons or timelines to specify motion.
  6. Generate Mandelbrot images by escape-time iteration. Map each pixel to a complex parameter cc. Start with z0=0z_0=0. Repeatedly compute zn+1=zn2+cz_{n+1}=z_n^2+c. If ∣zn∣>2|z_n|>2, the orbit escapes and the pixel is coloured by the escape iteration count.
    If it never escapes within the iteration limit, it is treated as inside the set.
  7. Generate Julia sets similarly but fix cc and vary the starting value z0z_0 over pixels. The Mandelbrot set is a map of which cc values give bounded Julia behaviour.
  8. Generate and measure simpler fractals by recursive replacement or iterated function systems. If a shape is replaced by NN copies each scaled by factor rr, its similarity dimension is D=log⁡N/log⁡(1/r)D=\log N/\log(1/r).
Figure. Notice that the choice depends on screen, printer, or artist control, leading to RGB, CMY/CMYK, or HSV/HLS and their component lists.
Figure. Notice the frame-by-frame cycle: keyframes or a script call the actor once per frame, compute object characteristics, render the frame, and repeat before playing the sequence.

Formulas

  • Normalized RGB to CMY: C=1−R,M=1−G,Y=1−BC=1-R,\quad M=1-G,\quad Y=1-B

  • For 8-bit values: C=255−RC=255-R, M=255−GM=255-G, Y=255−BY=255-B.

  • Normalized CMY to RGB: [RGB]=[111]−[CMY]\begin{bmatrix}R\\G\\B\end{bmatrix} = \begin{bmatrix}1\\1\\1\end{bmatrix} - \begin{bmatrix}C\\M\\Y\end{bmatrix}

  • CMYK conversion from normalized CMY: K=min⁡(C,M,Y),C′=C−K1−K,M′=M−K1−K,Y′=Y−K1−KK=\min(C,M,Y),\qquad C'=\frac{C-K}{1-K},\quad M'=\frac{M-K}{1-K},\quad Y'=\frac{Y-K}{1-K}

  • If K=1K=1, then C′=M′=Y′=0C'=M'=Y'=0.

  • RGB to HSV: let M=max⁡(R,G,B)M=\max(R,G,B), m=min⁡(R,G,B)m=\min(R,G,B), Δ=M−m\Delta=M-m. V=M,S={Δ/M,M>00,M=0V=M,\qquad S=\begin{cases}\Delta/M,&M>0\\0,&M=0\end{cases}

  • If Δ=0\Delta=0, set H=0H=0. Otherwise: H={60∘(G−BΔ),M=R60∘(B−RΔ+2),M=G60∘(R−GΔ+4),M=BH= \begin{cases} 60^\circ\left(\dfrac{G-B}{\Delta}\right), & M=R\\[4pt] 60^\circ\left(\dfrac{B-R}{\Delta}+2\right), & M=G\\[4pt] 60^\circ\left(\dfrac{R-G}{\Delta}+4\right), & M=B \end{cases}

  • If H<0H<0, add 360∘360^\circ. HH is in [0∘,360∘)[0^\circ,360^\circ).

  • HSV to RGB: C=VSC=VS, X=C(1−∣(H60∘ mod 2)−1∣)X=C\left(1-\left|\left(\frac{H}{60^\circ}\bmod 2\right)-1\right|\right), m=V−Cm=V-C. | Hue sector | (R′,G′,B′)(R',G',B') | |---|---| | 0∘≤H<60∘0^\circ\le H<60^\circ | (C,X,0)(C,X,0) | | 60∘≤H<120∘60^\circ\le H<120^\circ | (X,C,0)(X,C,0) | | 120∘≤H<180∘120^\circ\le H<180^\circ | (0,C,X)(0,C,X) | | 180∘≤H<240∘180^\circ\le H<240^\circ | (0,X,C)(0,X,C) | | 240∘≤H<300∘240^\circ\le H<300^\circ | (X,0,C)(X,0,C) | | 300∘≤H<360∘300^\circ\le H<360^\circ | (C,0,X)(C,0,X) |

  • Then R=R′+mR=R'+m, G=G′+mG=G'+m, B=B′+mB=B'+m.

  • HLS lightness and saturation: L=(M+m)/2L=(M+m)/2. If Δ=0\Delta=0 or L=0L=0 or L=1L=1, then S=0S=0; otherwise S=Δ1−∣2L−1∣S=\frac{\Delta}{1-|2L-1|}

  • Hue is calculated as in HSV.

  • Mandelbrot iteration: z0=0z_0=0, zn+1=zn2+cz_{n+1}=z_n^2+c, where zn,c∈Cz_n,c\in\mathbb{C}. A point cc is in the Mandelbrot set if the sequence remains bounded; a standard practical test is that if ∣zn∣>2|z_n|>2, it escapes.

  • Julia iteration: zn+1=zn2+cz_{n+1}=z_n^2+c with cc fixed and z0z_0 varying over the complex plane.

  • Similarity fractal dimension: D=log⁡Nlog⁡(1/r)=log⁡Nlog⁡sD=\frac{\log N}{\log(1/r)}=\frac{\log N}{\log s}

  • where NN is the number of copies, r<1r<1 is the scaling factor, and s=1/r>1s=1/r>1.

Worked examples

Example 1 — RGB and CMY conversion. Normalized RGB is (0.2,0.6,0.8)(0.2,0.6,0.8). Find CMY. Then convert CMY =(0.3,0.5,0.1)=(0.3,0.5,0.1) back to RGB.
Solution: C=1−0.2=0.8C=1-0.2=0.8, M=1−0.6=0.4M=1-0.6=0.4, Y=1−0.8=0.2Y=1-0.8=0.2. So CMY =(0.8,0.4,0.2)=(0.8,0.4,0.2).
For the reverse: [RGB]=[111]−[0.30.50.1]=[0.70.50.9]\begin{bmatrix}R\\G\\B\end{bmatrix} = \begin{bmatrix}1\\1\\1\end{bmatrix} - \begin{bmatrix}0.3\\0.5\\0.1\end{bmatrix} = \begin{bmatrix}0.7\\0.5\\0.9\end{bmatrix} Answer: RGB =(0.7,0.5,0.9)=(0.7,0.5,0.9).

Example 2 — RGB to HSV. For RGB =(0.8,0.2,0.4)=(0.8,0.2,0.4), compute HSV with hue in degrees.
Solution: M=0.8M=0.8, m=0.2m=0.2, Δ=0.6\Delta=0.6.
V=0.8V=0.8.
S=0.6/0.8=0.75S=0.6/0.8=0.75.
Maximum is red, so H=60∘(0.2−0.40.6)=60∘(−0.3333)=−20∘H=60^\circ\left(\frac{0.2-0.4}{0.6}\right) =60^\circ(-0.3333)=-20^\circ Add 360∘360^\circ: H=340∘H=340^\circ.
Answer: H=340∘H=340^\circ, S=0.75S=0.75, V=0.8V=0.8.

Example 3 — Mandelbrot iteration and complex values. Using zn+1=zn2+cz_{n+1}=z_n^2+c, z0=0z_0=0, c=0.1+0.2ic=0.1+0.2i, compute z1,z2z_1,z_2 and ∣z2∣|z_2|.
Solution: z1=02+c=0.1+0.2iz_1=0^2+c=0.1+0.2i.
z2=(0.1+0.2i)2+(0.1+0.2i)z_2=(0.1+0.2i)^2+(0.1+0.2i)
(0.1+0.2i)2=0.01+0.04i−0.04=−0.03+0.04i(0.1+0.2i)^2=0.01+0.04i-0.04=-0.03+0.04i.
So z2=(−0.03+0.1)+(0.04+0.2)i=0.07+0.24iz_2=(-0.03+0.1)+(0.04+0.2)i=0.07+0.24i.
∣z2∣=0.072+0.242=0.0049+0.0576=0.0625=0.25|z_2|=\sqrt{0.07^2+0.24^2}=\sqrt{0.0049+0.0576}=\sqrt{0.0625}=0.25.
Since 0.25≤20.25\le 2, the orbit has not escaped at this step. In this construction, the iterated value znz_n and the parameter cc are both complex.

Example 4 — Fractal dimension. A fractal is made of 88 copies, each scaled by 1/41/4. Find its similarity dimension. Also find the dimension of the Koch snowflake, which uses 44 copies each scaled by 1/31/3.
Solution: For the first fractal, N=8N=8, r=1/4r=1/4, so D=log⁡8log⁡4=3log⁡22log⁡2=1.5D=\frac{\log 8}{\log 4}=\frac{3\log 2}{2\log 2}=1.5 For Koch, N=4N=4, r=1/3r=1/3: D=log⁡4log⁡3≈1.2619D=\frac{\log 4}{\log 3}\approx 1.2619 Answer: first dimension 1.51.5; Koch dimension log⁡4/log⁡3≈1.2619\log 4/\log 3\approx 1.2619.

Example 5 — Match-the-list style. Match line, fill area, text and marker with attribute sets: (i) type, size, colour; (ii) style, colour, pattern; (iii) colour, size, font; (iv) type, width, colour. Also name the standard animation-language categories.
Solution: Line → (iv) type, width, colour. Fill area → (ii) style, colour, pattern. Text → (iii) colour, size, font. Marker → (i) type, size, colour.
Animation-language categories: linear-list notations, general-purpose languages and graphical languages.

Comparison

ModelComponents or primariesType and useKey exam fact
RGBRed, Green, BlueAdditive; displaysBlack (0,0,0)(0,0,0), white (1,1,1)(1,1,1)
CMYCyan, Magenta, YellowSubtractive; printingComplement of RGB: C=1−RC=1-R etc.
CMYKCMY plus black KKSubtractive; printingBlack ink reduces ink use and improves dark tones
HSVHue, Saturation, ValueArtist-friendlyValue is max of RGB; not a three-primary model
HLSHue, Lightness, SaturationArtist-friendlyAlso called HSL; order differs by convention
CompareHSVHLS
Full formHue, Saturation, ValueHue, Lightness, Saturation
Brightness componentValueLightness
BlackV=0V=0L=0L=0
WhiteV=1V=1 with S=0S=0L=1L=1
GrayS=0S=0S=0S=0
CompareMandelbrot setJulia set
Iterationzn+1=zn2+cz_{n+1}=z_n^2+czn+1=zn2+cz_{n+1}=z_n^2+c
VariesComplex parameter ccStarting value z0z_0
Fixedz0=0z_0=0Parameter cc
MeaningSet of cc giving bounded orbitSet of z0z_0 giving bounded orbit for fixed cc

Revision summary

  • RGB is additive; CMY is subtractive; each is the other’s normalized complement.
  • RGB and CMY are three-primary models. HSV and HLS are not three-primary models.
  • CMY to RGB: [R,G,B]T=[1,1,1]T−[C,M,Y]T[R,G,B]^T=[1,1,1]^T-[C,M,Y]^T for normalized values.
  • HSV = Hue, Saturation, Value. HLS = Hue, Lightness, Saturation.
  • HSL is the same model as HLS, with a different component order in the name.
  • An actor is invoked exactly once per frame.
  • Animation-language categories: linear-list notations, general-purpose languages, graphical languages.
  • Line attributes: type, width, colour. Marker attributes: type, size, colour.
  • Fill area attributes: style, colour, pattern. Text attributes: colour, size, font.
  • Mandelbrot: zn+1=zn2+cz_{n+1}=z_n^2+c with z0=0z_0=0; both iterated value and parameter are complex.
  • Escape radius in Mandelbrot/Julia iteration is 22: if ∣z∣>2|z|>2, the orbit escapes.
  • Similarity dimension: D=log⁡N/log⁡(1/r)D=\log N/\log(1/r); Koch =log⁡4/log⁡3=\log4/\log3, Sierpinski =log⁡3/log⁡2=\log3/\log2.

Previous-year exam insights

  • Acronym expansion is direct and common: remember HSV and HLS exactly; UGC uses HLS as Hue, Lightness, Saturation.
  • Primary-colour model identification: choose RGB and CMY; avoid options mixing HSV or HLS as “three primary colours”.
  • Colour-conversion questions often use normalized complements; the CMY-to-RGB vector is a subtraction from all ones, not subtraction of arbitrary constants.
  • Mandelbrot questions test the complex-plane definition: both the iterated value and the parameter are complex; do not treat either as real.
  • Animation terminology questions test the exact phrase “once per frame” for an actor; the frame rate is a separate concept.
  • Animation-language questions test the three standard categories; all listed categories are valid, so “none of the above” can be correct.
  • Output-primitive matching is a frequent trap: do not interchange line width with marker size or fill pattern with text font.
  • Fractal dimension and escape-time facts are often numeric: use D=log⁡N/log⁡(1/r)D=\log N/\log(1/r) and remember the escape radius 22.

Practice at PARIKSHA

You are ready for the PARIKSHA tests of this sub-topic when you can:

  1. Write RGB-to-CMY and CMY-to-RGB conversions for normalized and 8-bit values.
  2. Compute HSV from an RGB triple, including the negative-hue adjustment.
  3. State the full forms, components and ranges of RGB, CMY, HSV and HLS.
  4. Explain why HSV and HLS are not three-primary colour models.
  5. Trace one or two iterations of zn+1=zn2+cz_{n+1}=z_n^2+c and check the escape radius.
  6. Distinguish the Mandelbrot set from a Julia set by what is fixed and what varies.
  7. Compute similarity dimension for Koch, Sierpinski and a given N,rN,r.
  8. State how many times an actor is invoked per frame and name the three animation-language categories.
  9. Match line, fill area, text and marker with their standard attribute sets.
  10. Explain additive versus subtractive colour and the role of black in CMYK.

Attempt the PARIKSHA sub-topic test first, then the subject test.

Pages 1–2 of 2