It's a strange post because nobody answers the question posed by the asker who is clearly a complete beginner, wondering how images get converted to grayscale and sepia -- I think it's a much more basic question than the answers imply.<p>If you already know how to code, the math at the top of this article answers the question.
<a href="http://www.techrepublic.com/blog/howdoi/how-do-i-convert-images-to-grayscale-and-sepia-tone-using-c/" rel="nofollow">http://www.techrepublic.com/blog/howdoi/how-do-i-convert-ima...</a><p>If not:
Digital images are a big grid of pixels. Each pixel has a red, green, and blue value, each of which is usually a number between 0 and 255 because 8 bits are used to represent each value.<p>A "black and white" image (really grayscale) is created by setting the red, green, and blue values at each pixel to be equal to the exact same value as each other, for example we could choose the average of the original red, green, and blue values at that pixel. This removes all "color".<p>Sepia is similar but you take three differently weighted averages of the original red, green, and blue values to produce the sepia-red, sepia-blue, and sepia-green values in the result. See above link for the specific weights.<p>In both cases, each pixel location is computed independently, whereas other operations, like blurring, need to look at other nearby pixels as well.
Many image effects are based on shifting the color of each pixel based on the color of the 8 pixels surrounding it, for example blurring is essentially averaging the color value of the surrounding pixels. Experimenting with multiplying, dividing, combining, and inverting color values gives you effects such as emboss, drop shadow, glow, inverse, etc.