# Limited Opacity Levels in Image3D?

I'm trying to render a simple spherical distribution where the opacity varies with radius using Image3D. Unfortunately, the outcome is not very appealing, with discrete colors showing up in the rendering:

You can see that not only are the colors discrete, they are not even in order, with some darker bands appearing in the image in the lighter regions, whereas the image should have the appearance of a smooth radial gradient.

The code I used to generate the above image is:

res = 100;
coords = Table[{i, j, k} - 0.5, {i, Range@res}, {j, Range@res}, {k, Range@res}];
dists = Map[N@Norm[# - res/2.] &, coords, {3}];
opa = 1/(dists + 0.1);
opa /= Max@opa;
ImageAdjust@Image3D[opa, ColorFunction -> "GrayOpacity"]


My question is if there are limitations for opacity in Image3D, and if so, are there ways around it?

• In V9 I don't see the "alternating" effect – Dr. belisarius Oct 1 '14 at 16:13
• This is what I get – Dr. belisarius Oct 1 '14 at 16:18
• @belisarius I'm using V9 on OS X. Even if the banding is absent, the discrete color levels are undesirable, which I still see in your output. – Guillochon Oct 1 '14 at 17:14
• There is a question somewhere about Opacity having a sharp cutoff (ie not being able to represent low gray values). Probably a hint that it's working with discrete values. – Dr. belisarius Oct 1 '14 at 17:25
• I know that some volume renderers do only 256 discrete levels (IDL being an ancient example). I was hoping it was a global rendering option that perhaps was causing this. – Guillochon Oct 1 '14 at 17:33