Lesson 2:
Sensors and File Formats
There are really two kinds of sensors that you can
use for photography: electronic (digital cameras)
and chemical (film cameras). Both depend on the
fact that light has energy that can be released
when the light is absorbed.
Film
Basically, when light hits certain molecules in
the film, it changes them so that after you put
the film through various chemical baths
during development, light of certain colors
can or can't pass through the film. So the
number of the light-sensitive molecules that
change in a certain area during exposure
leaves a record of how much light was
absorbed by that area. Then after developing
the film, that information can be extracted by
shining light through the film again.
The standard size film for single-lens reflex
cameras is 36mm x 24mm (35mm film).
Digital sensors
Digital sensors will usually be referenced to
standard 35mm film by a crop factor, which
is (aptly) the factor that they crop each
dimension of the sensor relative to full frame.
Full frame digital sensors are the same size,
so their crop factor would be 1 (you get the
same field of view as with a 35mm film SLR).
Full frame sensors are still very expensive to
make, so they're only on high-end SLRs, and
a big part of the price difference is from that
alone.
Most SLRs' sensors have a crop factor
of about 1.5, which means that full frame
sensors are half again as big on each side.
This might not sound like much but it means
that a full frame sensor has a little more than
twice the area of one with a crop factor of 1.5.
Changing the size of the sensor also changes
the field of view—how much of the outside
world your sensor can see at a given focal
length. Imagine looking outside a window
and the window shrinks. Now you see less of
the outside world. Shrinking the sensor size
is basically the same thing.
A bigger sensor gives you a bigger angle of
view for a given lens focal length than a smaller
one.
So what actually happens when light hits the
sensor? The sensor is an array of tiny
photodiodes (diodes only let electrical
current go one way) with the cute name of
pixels (short for picture elements, which
sounds much too formal). When light energy
gets absorbed in the sensitive area of a
photodiode, the energy is converted into
making mobile electrons (current), which
then flow to one side of the diode. You count
up the number of electrons that got freed
during exposure and that tells you how much
light got absorbed at that pixel.
If only it were that simple. You've now got
three major issues:
(1) How do you count the electrons?
(2) How do you get color information if light
of every color can create electrons at the
pixel?
(3) How do you change the list of counted
electrons at each pixel into something that
makes sense to our eyes?
To solve (1)
You have to add little wires and
electrical circuits to the photo diodes. That
can be done, but all of it uses precious real
estate that you could be using to collect light.
Your sensor is less and less sensitive the more
extra stuff you put on. To try to minimize
that problem, they actually put microlenses
over each pixel to concentrate incoming light
onto the sensitive photo diode and not onto
the dead zone with the wires and amplifiers.
This is one of the major advantages large
sensors have over small ones: the bigger the
area of each pixel, the more light-gathering
each pixel can do. I would usually take a 6
megapixel picture from a large DSLR sensor
over a 14 megapixel picture from a point and-shoot
camera with a small sensor any
day.
For (2) they do some tricky things. Most
sensors filter the light coming into each pixel
so that only light of one color gets to the
photo diode for that pixel (the only
counterexample I can think of is the Foveon
sensor, which has layered photodiodes that
get different amounts of light of each color
based on their depth in the sensor. It has its
own set of problems, though). The standard
pattern of color filters over the pixels is called
the Bayer pattern.
It turns out that you can make almost all the
colors our eyes can see by mixing different
combinations of red, green, and blue light.
Each pixel in a monitor or TV has three tiny
spots, and you get different colors by
changing the relative intensity of those three
spots. So if you know how much red, green,
and blue light should be mixed in, you know
which color the pixel should be in the photo.
Sometimes you'll hear people talk about the
red, green, and/or blue channels, and those
values for each color are what they mean. To
get the red and blue values for the green pixel
in our example, a computer chip in the
camera will interpolate: it just averages the
closest blue pixels and the closest red pixels
to get the complete RGB (red, green, blue)
value for that pixel.
That's not the whole story, though, and we
finally come to (3).
When our eyes look at
something that gives off twice as much light
as something else, we see it brighter, but not
twice as bright. You'll see this if you sit by a
window and check what your camera's
automatic exposure does looking out the
window and compare it to what it does
looking in. (Since most people aren't
interested in actually doing things like this,
I'll do it for you.) I pointed my camera inside
and then, without changing the aperture, I
pointed it outside the door.
The shutter
speed for proper exposure changed from
1/100 to 1/2500, so right now my camera is
telling me there is 25 times more light
outside than in, but it looks like maybe 3
times brighter to me. So who's right? We both
are. To describe this, you would say that eyes
have a nonlinear response to light—all that
means is that the response doesn't follow a
line: doubling light intensity does not double
the perceived intensity.
Digital sensors are
almost completely linear: twice the light
means twice the electrons that get counted.
So to make the pictures look right to us, the
values the sensor records have to be
stretched. This is also done by a computer in
the camera. Or, you can save exactly what the
sensor sees and have the stretching done by
your own computer (it’s called a raw format
and I'll get to it in a minute).
ISO Speed
So besides controlling the exposure of your
sensor, there is another setting on your
camera that lets you decide how sensitive the
sensor is to light. They call it the ISO
sensitivity, and it's a throwback to the days of
film, when people would classify films based
on how much exposure they needed to beproperly exposed. The higher the ISO speed
of the film, the more sensitive it is to light,
and the numbering is conveniently chosen so
that ISO 200 is one stop more sensitive than
ISO 100 (it needs half the light ISO 100
needs), ISO 400 is two stops more sensitive
than ISO 100 (it needs 1/4 the light ISO 100
needs), and so on. In digital cameras, what
you actually change is how much you
amplify the number of charges made during
exposure before reading it out.
So set your camera to the highest ISO and
then you don't need fast lenses or long
exposure times, right? Well, it's not a free
lunch. The more you amplify the signal, the
more you amplify the noise from each pixel.
It's about the law of large numbers: each
photo diode doesn't even come close to
absorbing every photon (light particle) that
goes through it (it's a 25% kind of thing), and
if you give it enough photons to get a good
feel for how much light there is, you get
about the same number of electrons for a
given amount of light every time. But if there
are only a few photons to catch, the value
from one photo to the next (or from one pixel
to the next) will probably be wildly different.
Amplify those differences and...well...yuck.
The general rule is to use higher ISO only
when you have to, and use the smallest
possible ISO in every situation.
File formats
I mentioned before that you don't always
need to have your camera convert the raw
data from the sensor's electron counting into
something reasonable. Some cameras support
a raw format where you just store the red,
green, or blue value (but not all three) from
6
each pixel, as captured. I'll talk more about
raw files in a minute, but for now I'll mention
the other types of files so we can compare
them.
JPEG or JPG
Jpeg files are by far the most common these
days.
They are a compressed format, which
means they don't actually store the RGB
values for each pixel, but through some
complex math, it stores the way to get pretty
close to each pixel's RGB value when you
reverse the process. Jpegs are 8-bit, which
actually means that the red, green, and blue
channels are each broken down into 256
levels (or 28
, hence 8-bit) before the
compression. Somewhere black on your
image might have RGB values of [12, 7, 11]
and a pixel in the sky might be [50, 85, 220].
The major advantage with jpegs is that they
make files so much smaller.
TIFF or TIF
Tiff files can be either 8-bit or 16-bit (256
levels per channel or 65536 levels per
channel). There are compression schemes for
tiff files, but they don't compress files nearly
as much as jpeg compression does. Tiffs store
an RGB value for every pixel, so tiff files get
huge: 16 bits is two bytes, and with three
channels, that's 6 bytes per pixel. A 10-
megapixel 16-bit tiff with no compression,
then, will set you back about 60 megabytes,
and an 8-bit version will be half that. Yikes.
You can see why tiffs are usually used in
commercial settings where even the slight
loss of quality you get with jpegs is
unacceptable.
RAW (CR2, NEF, DNG, etc.)
Finally, back to my favorite file type and the
one that makes the most sense to me for backups: raw. Even if your camera's sensor
reads 12 bits (4096 levels) for each pixel, you
can have a raw file that is smaller than an 8-
bit tiff because you only keep one channel per
pixel—the file is stored before the
interpolation of the reds, greens, and blues.
For example, that same 10-megapixel picture
in uncompressed raw format will have 1.5
bytes per pixel, and you get a 15 megabyte
raw file.
That seems like a lot, but you don't
throw away any of the information the sensor
records, which can come in handy if you
need to change your pictures later (and let's
face it, we often do). My personal opinion is
that if you have a camera that supports raw
capture, you should always use it so
information that might be useful someday
isn't thrown away. It can't work miracles on
really bad pictures, but it can help and it's
only slightly more work to process raw,
anyway.
For the still-curious
A white paper on how you go from linear
capture from a digital sensor to something
logarithmic like your eye would see.
[http://www.adobe.com/digitalimag/pdfs/linear_gamma.pdf]
A really good article on shooting raw. [http://
www.bythom.com/qadraw.htm]
Subscribe to:
Post Comments (Atom)
-
Actually, that brings us to another important thing: it's not just subject motion that you want to stop—there's also camera motion. ...
-
By Lola Elise Most of the cover photos for famous magazines and different publications are taken with very simple photographic tools.
-
From presidential selfies to never-ending Instagram feeds, the world is now drowning in images. Celebrated photographers debate the impact o...

No comments:
Post a Comment