2010-06-11

How Cameras Work: Part I

I've been an amateur photographer for a few years now and, being of a technical bent, learned far more now that is ever good for me. So when my brother recently bought a DSLR camera to take pictures of his kid, he asked me for a few pointers. I thought I'd put the write-up up here for the benefit of others as well.

Now there's gobs and gobs of information on the net about cameras and taking photos already, of course, which I encourage everyone to pursue, but there's not so much on the surprisingly simple technical details of taking a photograph. Since the dawn of the digital age especially cameras have been getting more and more complex, but, from the user's point of view, this complexity is all just layered on top of the same basic settings we've been manipulating for close to two hundred years now. So here I'd like to clear through the cobwebs of all of those menus and settings and show you the simple bits underneath. Understanding that should help you understand the rest of what your camera is doing.

A camera consists of two basic parts, a body and a lens. These may come as one indivisible unit, such as in a point-and-shoot camera, or the body and lens might be interchangeable, as with an SLR or a DSLR camera. A camera with interchangeable lenses is almost invariably going to be of reasonably good quality (because there's no market for bad ones); non-interchangeable-lens cameras vary from as good as a good DSLR to complete rubbish.

The camera body's primary purpose is to be a light-tight box with a sensor (either film or a digital device) that can record images and a shutter that can fairly accurately open for a set amount of time and close again. That's it. Bodies often have many, many more features, but all the rest beyond being a light-tight box with a shutter are just gravy, and unnecessary for good photographs. On digital cameras these features often even get in the way of taking good photographs rather than helping, for reasons we'll see later.

The purpose of the lens is to focus light from outside on to the sensor, and on almost all cameras this is the key determinant of image quality. If you've got a poor quality lens, you'll get poor quality pictures, no matter how good the sensor. If you've got a good lens, you'll be able to take pictures as good as the sensor allows.

In the case of film, any modern film will record great images. Some of my best and sharpest pictures have been taken with an old compact film camera (an Olympus XA) simply because the camera had a great lens. For digital, well, of course it depends, but as I mentioned above, pretty much any major manufacturer's DSLR from the past five years will be pretty darn good. (Compact cameras, not so much.) Note that there's a lot more to a digital sensor than megapixels. People love comparing that, because it's a simple number that's easy to compare, but I've got plenty of good photographs that I've blown up to 10x15 (inches) and larger taken on my 6 MP Nikon D40; in terms of quality and the ability to work in low light it will easily outdo all or almost all 10-12 MP point-and-shoot cameras.

As with bodies, modern DSLR lenses tend to be very good as well, even at the low end. The kit lens that came with my D40, a cheap zoom that retails for under $150 separately, is surprisingly good, especially given that it's a zoom lens. Making a zoom lens, as opposed to a prime lens (one without zoom) entails a lot of compromises, which is why a $100 prime lens will often produce better images in lower light than a $500 zoom lens. But if you've got a DSLR, unless you're doing a lot of low-light shooting, the standard kit lens will do just fine for a while, by which time you'll know what else you want and need.

So how does all this work? There are really only four settings you're manipulating, though digital cameras, especially in "automatic" modes, can put a very large amount of mysterious crap between you and those four settings. Here, again, is an advantage of DSLRs; they invariably offer much easier access directly to the settings so that you aren't sitting there futzing with menus or waiting for your camera to figure out what's going on while your photo opportunity goes away.

Let me mention first something about exposure. One of the primary technical things you need to do when taking a picture is to make sure that the right amount of light gets to the sensor. The sensor records only a limited range of light values, and if you put too much light on it, called overexposure, you'll get a very "white" picture where areas that you saw as different brightnesses (details within clouds, for example) all turn into one flat white value as the sensor overloaded. At the other end, if you don't have enough light on the sensor, areas in shadows where you saw details will come out as a flat black area in the photograph. Finding the proper exposure can be tricky because, unfortunately, your eyes see a much, much wider range of light values than a camera does. So you usually need to select a subset of the range that you see to record as an image. If you want to capture detail in the brighter parts of the image, often you'll lose detail in the shadows, and vice versa. So if you see an image where the side of someone's body blends into a white wall, don't necessarily think that the photographer did a bad job; it could just be that there were some darker parts of the image where he wanted to capture the detail rather than having it be a flat black.

The four basic settings that determine a photograph are focus, aperture, shutter speed, and sensor sensitivity. That's it. There's nothing a camera, no matter how sophisticated, is doing that's doing anything but, in the end, manipulating these four settings. (Well, in digital cameras there's actually a bunch of work going on related to how digital sensors work, image compression, and suchlike, but that, except in the most esoteric of circumstances, is something generally best left to the experts who made the camera.)

Focus is probably the most familiar one to most people. What people may not be so familiar with is that focus of an image is not a "yes" or "no" issue; it's often the case that part of the image is in focus and part is not. This is due to the limitations of lenses, and is called "depth of field," usually abbreviated to "DOF." Having parts of the image out of focus is so common in fact that it's now turned into part of the art: photographers will often purposely put the background of an image out of focus to highlight the subject. (This is called "bokeh," from the Japanese for "blur." It's often quite noticeable in motion pictures where you can see the focus change from character to character as each speaks.) This is why photographers generally focus on the eyes in a portrait; faces with the eyes even slightly out of focus tend to look odd because those are what people tend to look at first.

Aperture refers to how large the lens opening is (the "f-stop") and thus how much light the lens lets through to the sensor. With almost all camera lenses this is variable via an iris inside the lens; typical values range from f/2.8 or lower (wide open) to f/16 or more (very closed down). Given that often there's never quite as much light as you'd like, why wouldn't you always just use a large (low f-value) aperture all the time? Well, as with all of these settings, there's a trade-off. A wider aperture does let in more light, but also reduces your depth of field, i.e., the range of distances from the camera over which the image will be in focus. With a very small aperture (e.g., f/16) it might be the case that everything from a meter away from the camera all the way out to infinity is in focus, whereas with a very large aperture (f/1.4, say, if your lens goes that wide open) you might be able to get someone's face in focus but not even her hands, much less the far background. So your aperture setting is both a technical (can I get enough light on the sensor?) and artistic (how much depth of field and how much blur of things other than the subject do I want?) decision.

Note that brightness is perceived and recorded logarithmically, not linearly, so aperture (and shutter speed, as we see below) work in ratios, doubling and halving. The step between f/2 and f/4 is the same size as the step between f/4 and f/8, and the same again as the step between f/8 and f/16. (Actually, a single "stop," as we call the standard step size in photography, is half the step size I described above, or the square root of 2—about 1.414—so a typical set of aperture settings available on a lens would be f/2.8, f/4, f/5.6, f/8, f/11, f/16, and f/22. You'll note that we round off these numbers a bit when we write them down, e.g. f/2.8 instead of f/2.828427....

There is some very interesting physics behind focusing and depth of field of lenses, by the way. I won't go into it here, but it's worth looking up if you're interested in that kind of thing.

Shutter speed refers to how long the shutter stays open and thus, as with aperture, influences how much light gets to the sensor. Low shutter speeds, such as 1/30th of a second (usually marked on the camera as just "30") allow a lot of light; high shutter speeds (say, 1/1000th of a second, or "1000") allow little light before the shutter closes. This is one of the primary means of controlling exposure to make sure that you don't let in too much light, producing an overexposed, very white picture with no detail in the brighter parts, or too little light, producing an underexposed, very dark picture with no detail in the darker areas. But there's also a compromise you need to make here: the longer the shutter is open, the more time things have to move, and so the greater the chance that something will be blurred in your photo. Thus, sports photographers often use quite high shutter speeds to capture an athlete rather than a blur. Even for very still pictures, this becomes critical anyway at speeds of about 1/30 and below, where the movement of your hands and body may blur the entire photo, if you're shooting hand-held rather than using a tripod. In this cases, anything you can do to steady the camera can help: pressing your arms against a table or wall, using the viewfinder to keep the camera pressed against your head, whatever. Also, note that if you're using a telephoto lens (or zoom lens at large zoom), your minimum hand-held shutter speed may be much higher, since the magnification of the image also of course magnifies any movements you make.

Shutter speed interacts with aperture, of course, and is the primary means of getting a choice of apertures. Halving the f-number of the aperture requires a quadrupling of the shutter speed for the same exposure, so if a scene is properly exposed at 1/125 and f/8 I can take it instead at f/4 and 1/500 and get the exact same exposure. I might do this because I'm shooting something moving very quickly and I'd get too much motion blur at 1/125. or I might want to reduce the depth of field to blur the background in a portrait, in which case I might even go further, to f/2 and 1/2000.

Sensor sensitivity also determines how much light you need to make a properly exposed image, and as with the other values, has its trade-off. The more sensitive a sensor, the more noise you'll have in an image. (This is seen as grain in film images, or just "noise" in digital images.) Sensitivity is generally measured in ISO units, and typical values range from 100 or 200 (not very sensitive, but very clean) to 1600 or more. While for a roll film camera you pick your film and are stuck with the same sensitivity for the entire roll, digital cameras have the advantage of being able to change the sensitivity from shoot to shot. (Many cameras even have a convenient automatic mode that will use a low sensitivity when there's plenty of light, but automatically raise it in low light.)

As with aperture and shutter speed, sensitivity as logarithmic; the standard steps are usually 100, 200, 400, 800, 1600 and sometimes 3200 and beyond. But one thing to be careful of is that in the digital world sensitivities and noise for a given ISO vary from camera to camera. For sensitivity this is a fairly small variance; "ISO 200" on one camera may be the same as "ISO 125" on another. But the amount of noise varies a lot: ISO 1600 on a good DSLR may produce an image with less noise than ISO 800 on a point-and-shoot with a smaller sensor. The smaller sensor will, however, produce greater depth of field at the same aperture. And, of course, as yet another part of the trade-off, larger sensors usually cost considerably more than smaller ones.

So these four settings, focus, aperture, shutter speed and sensor sensitivity (ISO) are what you have to work with. Anything else you're fiddling with is just changing one of these. But how do you use them? As this has gotten quite long already, that's going to have to be the topic of a second post next week.

2010-06-02

To What Did I Just Agree?

Sony the other day sent me a note (hours before the event) saying that they were changing their PlayStation online agreement and I needed to agree to the new one. No indication of what the changes were, of course, just a lot of text, without even an agreement checkbox, actually. (When and how—and if—I agree to this, I don't even know.)

I hope I didn't give them my immortal soul.

But the problem of these extraordiarially long agreements for simple consumer transactions, and the power imbalances inherent in them, has been well known for a long time and discussed extensively.

Which got me wondering about this power imbalance. It's not just that the other side has a lot more lawyers than I do (an infinite number more, actually, if you consider that to be the result of division by zero), but also that my choices are limited, essentially, to "accept or don't buy that $10 downloadable game." Were I negotiating the kind of contract I negotiate in business, say with a potential employer or employee, both sides are a lot more equal in that I can return a copy of the contract with additions, changes and strikeouts, and suggest that we work from there instead. Negotiations then proceed. But that's not going to happen in the consumer world.

With a consumer contract, since the vast majority of consumers are willing just to click the box regardless of consequences in order to avoid the hassle, the few people who are willing to take the time to read the contract and perhaps disagree with a few terms have no real way to compel the company to change it. Companies with large numbers of consumers can easily afford to ignore those people since it costs them only a few small sales. How can we fix this?

Here's my crazy idea. For these on-line contracts (and perhaps this could be done with paper, too), force everybody to read and truly agree with them by having them, after reading each paragraph, answer a short, simple multiple choice question about that paragraph.

If contracts were less enforcable without this evidence that the consumer had read and understood every provision, a lot more consumers would default to not making the purchase because they aren't willing to deal with the hassle of proving they'd read and understood the long contract. That would cause pain to those who write long and complex agreements, and provide a lot of encouragement to those selling goods of relatively low cost to write short, simple ones instead.

I'm not sure that this is an idea that's ever likely to be put in to practice, but it's an interesting thought.

2010-06-01

It Just Got Personal

Through the usual weird six-degrees-of-separation-chain-of-links that happens on the web, I happened to run into the diaries of someone raised by dominionists.

In case you want to get on with life instead of following the links, dominionism is essentially a totalitarian movement to have the world ruled by radical Christians of the U.S. flavour. It's in no way a majority, or even a plurality, but it's far from just a cult.

Reading about this fellow's experiences, I came across a quote from this post that chilled me to the bone:
[O]ne time in 5th grade, I had made a comment that was in fact seen as socially acceptable by the dominionist group that raised me...that I hoped that "godly people took over and did to the atheists what Hitler did to the Jews".
Now think about this. My eyes are blue, my natural hair colour is dark blond, and I'm pretty much your standard person of northern European descent. I'm about as white as they come, and by looks alone I'd probably be quite acceptable to pretty much any western conservative movement, from fundamentalist Christians to neo-Nazis. While I've always appreciated intellectually all of the innumerable forms of hatred for a category, whether it be blacks, gays, Jews, or whatever, all the way up to the plight of the Jews during the Holocaust, I'd never thought of being in one of those groups.

Well, apparently now I am. There really are people out there who would be happy to see me die because I'm an athiest, and they're not the terrorists that Bush & Co. are worried about. Most of them live in "the land of the free."