So we have two terms to discuss today: histogram and bit depth. And they are related and let's
start with bit depth and first a bit of trivia for you bit is short for binary information digit
not quite an acronym but I guess close enough and bits are fundamental to how computers work and
they're also the building block of all digital information, all the videos photos and text you
see on a computer screen are really just zeros and ones, bits. The important thing for this video is
what we mean by bit depth when it comes to images on a screen and let's start with a bit depth of
one. A bit depth of one means you just have a single bit to work with, so we only have
two states or two brightness values to make the image. Zero which means fully off or black and
one which means the pixel will be fully on or saturated. And you may be thinking why are you
starting with such a basic example? No camera works that way. Well, maybe. But I'm old enough
to remember that the first computer i used had a display that i think really had a bit depth of one
any pixel on the display could only be offer on zero or one
and it was green because they used a green phosphor in the cathode ray tube for some reason
anyways if we move on to a bit depth of two we get four values to work with if we move on to a
bit depth of three we get eight brightness values to work with you see how this is working because
we do 2 to the power of whatever the depth is so 3 bit depth would mean 2 to the power of 3
we get 8 brightness values so let's stop at this point and and look how how we make a histogram
which is just a chart that displays how dark or bright every pixel in a digital image is so i'm
going to get a bit creative here and i'm going to make a very basic image out of cups of tea and
in terms of a digital image you can think of each cup of tea as being one pixel in the
image and i'm actually basing this on what a small star looks like really zoomed in
all right and there we go so now let's rearrange these cups into a three bit histogram
on the x-axis we go from zero to seven because we get eight values to work with
from a bit depth to three and on a histogram the y-axis is just a count of how many pixels
we have at each brightness value so let's put these side by side now and let it sink in what
the histogram is really telling us it's telling us the number of pixels at each brightness value
based on the bit depth of the image in this case it's a three bit image let's jump up now to a bit
depth of eight as this is the usual histogram you see on a camera screen or in photoshop
and eight bits is also the standard for jpegs video basically anything you see on the web
so with eight bits we get 256 possible brightness values because 2 to the power of 8 is 256.
on an image histogram 0 is still black while white is fully saturated and that's now 255. middle
gray is at like 128. now you may be thinking at this point this doesn't seem like enough just
255 values to fully represent a photo but so far in this video we've just been talking grayscale
while what is called true color in an image is red green and blue and each of those channels gets
256 possible values so that's what it means when photoshop says 8 bits per channel the channels are
red green and blue and to arrive at the total number of possible colors from red green and
blue each getting eight bits to work with we would multiply 256 by 256 by 256 to arrive at 16 777 216
possible color variations which for most kinds of images is plenty to accurately represent the scene
the reason we often use a bit depth of 16 or 32 in astrophotography is because we're stacking many
images together which adds precision and we do this while the image is still in the linear space
where the histogram is compressed and bunched up over to the left-hand side
and then with that added precision it's going to be very helpful when we stretch the image
out which really opens up the mid-tones and spreads them out creating contrast and very
importantly separation which helps bring the dim nebula or galaxy out from the sky
which in truth is usually pretty close to the same brightness value as the deep sky object
but stacking adds that precision and then we can stretch it out well i'm out of time i'm sure i'll
do follow-ups because there's tons to say about bit depth histograms so drop your questions in
the comments. This has been Nico Carver with another five minute Friday. Clear skies!