If you already know how to code, the math at the top of this article answers the question. http://www.techrepublic.com/blog/howdoi/how-do-i-convert-ima...
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.
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".
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.
In both cases, each pixel location is computed independently, whereas other operations, like blurring, need to look at other nearby pixels as well.