3

I have been trying to understand how a better spectrum of color can be represented in an image and to avoid banding it sounds like the image would need to have more bits per pixel. When the resolution of an image increases, do the bits per pixel also increase?

4

Image resolution (amount of pixels) and bit depth (bits per pixel) can be changed independently. Any combination of high/low resolution and more/less bits per pixel is possible.

Sometimes, however, higher resolution can make up for lower bit depth. Individual pixels become invisible and we start perceiving patterns of pixels as shades, as if the color depth were increased.

enter image description here

This is also the case of film photography, where individual "pixels" can only be black or white, and yet we can clearly see the shades of gray, because the individual image elements are so tiny. (ignoring color film photography for simplicity)

By Robert James Wallace - Plate VII from "The Silver 'Grain' in Photography" by Robert James Wallace, The Astrophysical Journal, Vol. XX, No. 2, Sept. 1904, pp. 113–122, Chicago. As reproduced by Google Book Search. See also [1]., Public Domain, https://commons.wikimedia.org/w/index.php?curid=12220056

  • 1
    +1 nicely demonstrated – mattdm Apr 30 at 1:33
  • 1
    Is there a version of the second image that makes the writing legible? – Michael C Apr 30 at 14:53
  • Ouch. I think you have some concepts wrong. Film photography CAN have shades of gray. even Lithophotography, where contrast is so high that we could think they have not, they have, and it can even be controlled at some tiny extent. The principle applies to printed photography on a mass production system, like lithography or offsets printing, where you have ink or you do not have it. That is where screening came into play. – Rafael Apr 30 at 20:07
  • 1
    of course film photography can have shades of gray, it's just that magnifying this gray reveals it is made of film grain – szulat Apr 30 at 20:15
4

A pixel can be understood as a 3-dimensional thing.

A pixel holds information. How "deep" this information can be is the trick.

Pixel Depth

Here is a representation of one pixel. On the left, it can potentially hold information about any of 4 stages.

On the right, it can have more options or levels to choose from.

enter image description here

But "resolution" is having more pixels, but this is independent of how many depths each of them has.

Here I have 9 with the same depth as before.

enter image description here

So, resolution and bit depth are independent.


Steps

better spectrum of color

Ok, here we are talking about something broader.

How subtle this gradients can hold depends on the contrast between the steps. On these examples, the contrast between the edges is, of course, bigger on the upper case, but as you decrease it you can potentially need fewer steps to render it.

enter image description here

Here we can jump into a different issue that is dynamic range. But that would be a text for another occasion.

Resolution

@szulat made a point. But I think that need to be explored a bit more.

Yes, it can help, but especially if you add another variable... Noise, dither or screening.

Here I have a base grayscale image, with some 256 levels of gray.

If I do not have enough bits, to have enough grays for the gradients I would end with something like this. This is the extremest case of banding.

On a printed image (where we do not have 256 different shades of gray inks) we use some different types of patterns.

On an inkjet printer, we normally have a dither or error diffusion pattern:

(I am cheating a bit here, the image still has some grays but it is so they look nicer on screen)

On some commercial printing systems, we have halftone screening

So, despite the fact you have only 1-bit images, you still have gradients... when viewed on a distance.

This is where resolution comes into play... The higher the resolution, the smaller the dots, the better the illusion.

Add noise

On normal 24 bit images like a blue sky on a JPG file, the banding can be reduced adding some noise. This can produce an effect similar to the dither on the previous example.

  • Nice — are these your original images? – mattdm May 1 at 1:18
  • Yup. Almost every image I post is. If the case I post a link to the original image. – Rafael May 1 at 4:30
2

Not in common digital imaging terminology. Instead, we call bits-per-pixel bit depth.

Once unpacked from whatever compression format they were stored in, digital images are usually represented as triplets of red, green, and blue ­— each of these is a "channel". (There may also be a channel representing transparency, although that's more of an image editing or graphics design thing than of interest to photography.) If you have more of these triplets (like, 6000×4000 instead of 3000×2000), we say you have more resolution. If you have more bits per channel (say, 16 instead of 8) we say you have more bit depth.

It gets more complicated than this when you consider non-linear encoding, color spaces, and so on, but that's the basics. For your purpose, it's true that greater bit depth can help reduce banding. Be aware, though, that most devices can only show 8 bits per channel and many consumer devices are much worse. And common file formats online are only 8 bit. So, you probably want to reduce to 8 bits on your own system even if you work in higher bit depth, so you can control how the banding looks.

One approach is to introduce a dithering pattern. In fact, having higher resolution can help here — you basically trade some of the spacial detail for colors.

0

The resolution is a measure of the pixels per unit of physical length. So to increase the resolution of the image you mostly have to increase the pixel count.

The number of bits per pixels (a.k.a pixel depth) doesn't change the resolution. However, any global color change induces color loss (several different values are mapped to the same output value), and banding appears when this produces large uniform areas next to each other. With the usualy 8-bit/channel, color loss happens quickly, losing 10 to 20% of the color values is not uncommon. Increasing bit depth decreases the relative color loss, so banding is a lot less likely to happen.

This is one purpose of "shooting raw", the output of the sensor is 12 to 14 bits per channel (depending on cameral model), somewhat better than the 8-bits in the camera JPEG, so you have more material to work on (though in practice in your factor in sensor noise and demosaicing you are closer to 10-12 bits/channel).

But high-bit-depth is mostly for storage and processing, most images formats are 8-bit/Channel and many displays are barely good enough for 8-bit depths.

  • Raw doesn't really have "bits per channel", it just has a single monochromatic value for each photosite. Color channels aren't introduced until demosaicing. – Michael C Apr 30 at 14:51
  • even if we call raw monochromatic, which is absurd, monochromatic or grayscale images still have bits per channel, it's just one single channel :-] – szulat Apr 30 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.