Graphics Reference
In-Depth Information
straightforward; choosing the right one to use when you want to create a par-
ticular effect takes experience and some time.
Exercises
1. Complete the work of the CMYK separation example by presenting the
four separations in their actual color, instead of in grayscale. You may
use any image you like, but the file Figure-11.3.tif is included in the
resources for the topic so that you may compare your work to that in this
chapter.
2. Create an anaglyph of a familiar scene, such as part of your home or cam-
pus, by taking two digital photographs from nearby points that frame the
same portion of the middle ground of the scene, and combining them as
described in this chapter.
3. Implement image rotation by any multiple of 90° by taking the original
texture coordinates and applying trigonometric functions to them.
4. Implement image flipping or image inversion , the process where the top and
botom of an image are reversed. Do the same for reversing the left and
right sides of an image.
5. Implement some different image warping approaches than the one we
discussed in the chapter. Consider how you might use trigonometric
functions in only one direction, exponential functions, or other kinds of
manipulations to the texture coordinates.
6. Implement selective coloring . Using the luminance value, it is simple to
convert an image to grayscale, but this can be done selectively. Get an
image for which one thing stands out in a different color (for example, an
apple on a windowsill) and make everything grayscale except that one
thing. Use color testing on each pixel to decide whether or not to change
it.
7. In the discussion of the interpolation operation, we use the equation
below to combine the two colors we are blending:
vec3 target = vec3(0.5) - 0.25*cos(PI*brgb) -
0.25*cos(PI*argb);
Experiment with the values used to control the blending. As a first try,
you might vary the base color b and the subtractive terms s in the equation
vec3 target = b - s*cos(PI*brgb) - s*cos(PI * argb);
Search WWH ::




Custom Search