Its not true that a human can not see banding in 256 colors. Whether or not you do depends quite much on what the transfer curve of the monitor is and if its a low quality LCD with diminished color spectrum, like in many phones. Also human eyes are really well adapted to sensing just this kind of thing so while 256 colors in general is fine its not so good when you have straight fronts, Mach bands and all that.
You can use a trick commonly used in 3d rendering, make the color slightly inpure. What happens is the linear interpolation between the edges now cross boundaries at different points for different channels leaving you with more colors to discrete color values travel trough.
Another option is to jitter your sampling pattern a bit so that not all pixels reach the same value at once. This dithers the color causing a more natural spread since human eyes dont pay attention to individual pixels.
Listing 1: Noise pattern jittered per channel you could also jitter only gray
rGray[x_] := IntegerPart[256*(x + RandomReal[{-3.0/256, 3.0/256}])]
dColor[x_] := {rGray[x], rGray[x], rGray[x]}
Image[{
Map[dColor, Range[0, 1, 0.02]],
Map[dColor, Range[0, 1, 0.02]],
Map[dColor, Range[0, 1, 0.02]]
},
"Byte"]
Listing 1 is on purpose a bit exaggerated so that you can more easily see the effect.
Image 1: Result of the code the number of pixels is small and the effect exaggerated zoomed so its easier to spot every pixel and see the effect.
You could also use noise only on one of the color channels or just on the gray to alter the effect to more subtle and not so color noisy. Here's a more subtle real size example
Image 2: a wider gradient noise toned down and in right scale. Open the image to a separate tab so you can see it unscaled
Yo might do better with a pseudo stochastic pattern. Other things to do is do the computation gamma corrected etc etc.
Image
display render an array of numbers with more than 256 shades per color channel of color resolution. I'm not sure if this is actually possible (I don't know much about graphics hardware and what its limitations are). $\endgroup$Image
uses floating point values for pixels which can represent a very large number of shades (seeImageType
). However, Mathematica cannot display more than 256 shades of grey. (Certain programs on certain operating system can display 1024=2^10 shades if the hardware supports it---that means video card and screen, I think.) So the question: is your aim to represent more than 256 shades, or to display them? The first is easy, the second can be approximated by dithering. $\endgroup$