I assume from your question that you're just seeking to emulate a certain look, and you're not seeking to actually output that data into a file format with reduced range. In other words, it shall look like it was an image with reduced bit depth, but in fact it's a normal 8 bit jpeg or png that you're outputting.
If that's the case, that look could somewhat be emulated using node groups. I've put together a little demo with a Suzanne head and a random image (Agent327 header from the Blender.org homepage), which run through a custom node group:
Please keep in mind that the node group does not do any sophisticated range mapping. There is no analysation of surrounding pixel data to produce an image which is as close as possible to the original. It really just tries to add the - usually unwanted - fake posterization.
To do this, the image needs to be split up into its individual channels, as we want to work on the mathematical values there:
You'll see two things in this tree:
- using separateRGB and combineRGB nodes, I split the channels into its individual components, and then run each through a custom node group
- There is a Power function involved (Gamma). What I'm doing here is mangling the Display Referred pixel values instead of the scene linear ones. The mapping to target values looks more natural this way. You can mute both gamma nodes to see the difference when testing with the photo. This also means for you that you need to take care what you feed the node group with, as it expects the input to be within a 0.0 - 1.0 range
The channel node group itself looks like this:
The user outside of the node group sets a number of colors per channel. But the range the group works on starts at 0, so a 0 - 7 range = 8 colors. That's why I subtract 1 at the beginning of the tree.
Then comes the actual trick. The values are multiplied by the number of colors. So now, the channel values range from 0.0 to 7.0. But usually they are something like 3.76622. Now, that value is going through the Round node. There, 3.76622 becomes 4.0, while 3.422 becomes 3.0. By that, the channel values are spread apart, the smooth interpolations disappear, posterization happens. The result is divided again by the number of colors, to get back to 0 - 1 range.
Output (with 8 colors):