Jump to content

How to fix color banding?


wannabeartist
 Share

Recommended Posts

Hi all,

 

I've been asking this around, but so far I haven't really seen an answer that would solve it. How do you manage color banding?

 

I'm having some color banding issues in my latest project and to better pinpoint the problem I made a really simple test scene with just a box for a room and 4 IES lights to light it.

 

I have photographic exposure control in use and I have tried saving in EXR to allow maximum bit depth for the image. I'm using the 32-bit framebuffer too. FG is quite low, but in my experience, even the highest values don't affect this problem.

 

You can see pretty noticeable banding on the back wall of the screen shot. It's really as if it's still using only 8 bits - am I missing something here?

 

EDIT: actually it's much more noticeable in the EXR. The screenshot is a jpg and it benefits from the fuzziness...

Edited by wannabeartist
Link to comment
Share on other sites

Perhaps I can't see what's going on too well on my monitor, but is this effect not simply from the IES light shapes? It's difficult to tell from this shot how close the lights are to the wall given the camera FOV. What happens if you use non IES spotlights?

Link to comment
Share on other sites

Thanks for the suggestion!

 

But I don't think the lights are the problem. In fact you can get a similar effect with the physical sun too, in some situations. I still believe, that this has something to do with bit depth and my noobness.

 

To verify this, I switched to spotlights and the result is almost the same. I wish I knew how to post these screenshots correctly, so that they would show the full effect without jpg blurring it - but it's some heavy banding, alright, you just need to take my word for it :)

Link to comment
Share on other sites

Sorry - I should have suggested area lights to negate a light cone. There does not seem to be much indirect illumination bounce of your light, which perhaps is contributing to the effect. You can get splotches of light with low FG and Photon settings, but it still looks like overlapping light cones to me - but if you say they are not I believe you :)

 

Out of interest, what are your gamma settings and what colour depth is your Windows monitor display? It's probably 32 bit but worth checking.

 

Cheers

Link to comment
Share on other sites

Now that you mentioned the possibility of overlapping cones, I went and got rid of 3 lights leaving just one in the scene. I also set FG to the "high" preset, but still, no cigar :)

 

Here's a screenshot of the current setup. If I managed to keep the picture looking the same as it does on my display, you can spot the banding effect where the lighted area ends and the shadow starts, for example on the right side.

 

I checked the color depth, it's 32-bit. My max gamma settings are 2,2 for everything, but this particular image was saved as EXR and with a gamma of 1.

 

I think I have some sort of understading of linear workflow, when it comes to importing textures and so on, but I'm rather hopeless on the other end, saving images correctly :)

Link to comment
Share on other sites

You shouldn't get any banding with even 16-bit; could it be your minitor? We tested 24" Dell, and colour banding made it unuseable for colour correction (30" Dells are fine). Try printing your image to see if it's hardware-related.

Link to comment
Share on other sites

Bruce, I tried saving in TIFF, but there's no difference. The frame buffer shows the same banding effect.

 

David, I don't have a printer, but I can try to view the image on my laptop in a minute. I'm using a Samsung 204B on my desktop, no obvious image quality problems before, but I may have overlooked them before I started rendering.

 

I also tried to render one without exposure control, as I was reading this last night, but removing exposure control didn't do anything for the banding in my image.

Link to comment
Share on other sites

I made couple more tests with physical sun.

 

This time I dragged the EXR to Picturenaut (tone mapper from hdrlabs) and tone mapped the image with the exposure method.

 

I tried both with and without mental ray's exposure control (doesn't make much sense to tone-map it twice, I think?). I saved the results as 8-bit TIFFs and examined them in Photoshop. While they are not exactly the same, the banding is present in both results. Argh! What am I doing wrong here?

 

(The screenshots are pngs and not the original tiffs, but the banding effect is still visible on the shadowed part of the curved surface and in the sky too!)

Link to comment
Share on other sites

Yet another test with Picturenaut...

 

Playing with the exposure slider in Picturenaut, I came to wonder if it's actually supposed to look like this when you "under expose" the image?

 

If that's the case, then I guess need to start doing some serious post editing, because the scene where I hit this problem is supposed to be a dark evening scene of a living room (it has a dark sofa with horrible color banding).

Link to comment
Share on other sites

I haven't calibrated this monitor at all, to be honest.

 

I should, of course, but in the absence of the tools for it, I took a look at the images on my tv (connected to the pc via HDMI) and my laptop (Macbook). Of course, they are not any more calibrated than my display, but they are different and I can still see the banding effect in both.

 

Did you check out the sun pictures? You don't see any banding in the curved wall?

 

EDIT: actually I'm even more surprised by the fact that it doesn't seem to matter whether I save in 8-bit format or 32-bit format. The result looks the same. And I don't believe my monitor can be so completely wrong - at least if I look at Wikipedia's example on color banding, I can see the difference very clearly :)

Edited by wannabeartist
Link to comment
Share on other sites

I haven't calibrated this monitor at all, to be honest.

 

I should, of course, but in the absence of the tools for it, I took a look at the images on my tv (connected to the pc via HDMI) and my laptop (Macbook). Of course, they are not any more calibrated than my display, but they are different and I can still see the banding effect in both.

 

Did you check out the sun pictures? You don't see any banding in the curved wall?

 

EDIT: actually I'm even more surprised by the fact that it doesn't seem to matter whether I save in 8-bit format or 32-bit format. The result looks the same. And I don't believe my monitor can be so completely wrong - at least if I look at Wikipedia's example on color banding, I can see the difference very clearly :)

 

I can see banding on every image I look at on my monitor if I look at it at the right angle...

 

I have printed your images and I see no banding.

 

http://en.wikipedia.org/wiki/Posterization

Link to comment
Share on other sites

  • Administrators

I've taken a look at all of the images you've posted and while some show some very slight banding, none are severe on my display, so I'm thinking this issue is related to your display and/or the bit depth you have set for your video card. Can you check that your settings in your video card control panel are set to 32 bit. As for the display what monitor are you using? Is it a laptop or an LCD display? Can you post the model number. Displays can sometimes display banding if the calibration is wrong (which you have not done), or if they are not really good quality. Cheap low bit depth LCD displays will often exhibit banding on strong synthetic gradients.

Link to comment
Share on other sites

...

Can you check that your settings in your video card control panel are set to 32 bit. As for the display what monitor are you using? Is it a laptop or an LCD display? Can you post the model number. Displays can sometimes display banding if the calibration is wrong (which you have not done), or if they are not really good quality. Cheap low bit depth LCD displays will often exhibit banding on strong synthetic gradients.

 

This is good advice about checking your card...

 

I think the monitor (Samsung 204bw) is a good display, despite problems with the stand.

Link to comment
Share on other sites

James & Jeff, then it has to be my monitor after all.

 

I'm using a few years old 20" Samsung TFT, 204B - definitely not the latest and greatest, but it's the first time I ran to quality issue with it, granted that I haven't been doing rendering / paying utmost attention to it for very long either.

 

The graphics card is an NVIDIA GeForce 9400GT, which claims to be using 32-bits for color. I just updated it's driver today to get the new Composite working.

 

So, most likely it's indeed a display issue then, my laptop (regular Macbook) is definitely no better. I will try to get a better display soon :)

Link to comment
Share on other sites

  • Administrators

I would try checking on a higher end display if you can. Macbook (Pro) displays are crap. I know..I have one, and their color gamut and reproduction are some of the worst I've seen. In fact they can not even reproduce the colors in the sRGB gamut, by some pretty large margins in some colors. I often see banding on my Macbook Pro.

Link to comment
Share on other sites

Yes, I suppose I should consider a better display - although as James said, it's not that bad overall, but it's not a high-end display either. And I think I bought it back in 2006.

 

I've heard that too on the Mac's displays. Mine is not even Pro. That was just for test viewing though, for modeling and rendering work I've been using my desktop pc with the Samsung 204b.

Link to comment
Share on other sites

I'm not fully hep to what's going on in the world, but feel that if there were monitors out there regularly doing better than 24-bit colour I'd be aware. Suspicious I had a quick check at Wikipedia and found this (http://en.wikipedia.org/wiki/RGB_color_model#Beyond_the_24-bit_RGB)

 

-----8

32-bit graphic mode

The so-called 32 bpp display graphic mode is identical in precision to the 24 bpp mode; there are still only eight bits per component, and the eight extra bits are often not used at all. The reason for the existence of the 32 bpp mode is the higher speed at which most modern 32-bit (and better) hardware can access data that is aligned to word addresses, compared to data not so aligned.

-----8

 

So I'm thinking that yes, even if you "are in 32-bit mode" you aren't.

 

So then we get to the fact that humans don't respond evenly across the spectrum. We're extra good at green (the whole living on the savanah thing may account for this). I saw varying amounts of banding on the images shown. Some I know was from JPEG, others looked to be nicer (were they PNGs?) and not JPEG caused. JPEG typically will assume "enh, it's colors, people suck at colors, don't use the bandwidth.

 

I noticed some hue based mach banding and think (didn't test and not read up on it) that this is because RGB values don't step evenly from point A to point B. This can be just because A and B don't have evenly spaced RGB values so interpolation is necessarily not in synch. It might also be (depending on the application) because it is realized that by stepping all three at once there would be a broader change in brightness than by just changing one value and what's that do... enh, it only hinks the hue a bit people suck at hue so don't worry about it. BUT I wonder (haven't tested and am not read up on it) if may in this kind of circumstance the color difference isn't picked up by the mach banding creators in our perception systems which serves to increase the effect. Dunno.

 

Short story - you are very very probably only seeing 24-bit color and 24-bit color isn't quite enough actually especially in certain greenish circumstances. And a quick gradient in PShop shows that banding shows up more at dimmer values (because it's more important to see if the grass is going to bite you in the dark?).

 

Solution? Same one Photoshop uses and maybe the same one printing from 32bit source data uses.... noise. Ermm... "dithering."

 

Now... how to apply that...

 

I'm trying to test a solution and my control (no noise) copy/pasted from max to pshop is showing pixel to pixel changes of no more than 1 but often in more than one channel.

 

OK, here's a first stab. I don't think I quite like it. YMMV. I think the problem stems from the fact that dithering isn't really noise. What I did was add a Noise as a Projector Map on one of the lights. Set the size to 0.01 and the colors to 250 and 255. Maybe it helps you. Note that if you are going for physically correct light, you just dimmed your light (let me guess and ignore the fact that light isn't linear...) say 5/255 is 2% so take half (midpoint between max dimming and no dimming) 1%.

 

I can't say which I prefer. I didn't get banding as noticable as some of yours. .. Maybe if I make the light brighter and thereby make it fall off quicker... Nope, various experiments aren't making it go. I worry that the grain of the noise will be more visible in situations where the banding was more visible (due to clumping and mach banding).

 

Oh yeah, I also made the noise fractal to help increase grain. I tried speckle, but it kept clumping uselessly. Might be worth trying putting noise in a material's bump rather than in the light.

 

Not sure this has been worth your time. Hopefully it has goodness.

Link to comment
Share on other sites

So I'm thinking that yes, even if you "are in 32-bit mode" you aren't.

 

Short story - you are very very probably only seeing 24-bit color and 24-bit color isn't quite enough actually especially in certain greenish circumstances. And a quick gradient in PShop shows that banding shows up more at dimmer values (because it's more important to see if the grass is going to bite you in the dark?).

 

Solution? Same one Photoshop uses and maybe the same one printing from 32bit source data uses.... noise. Ermm... "dithering."

 

Thanks for the ideas!

 

It's sometimes very confusing with these bit depths.

 

The sRGB Truecolor is referred as "24bit format", although it is of course actually just 8-bits per channel, so 8+8+8=24. And if you have an alpha channel, you add 8 more, totaling 32bits. But it's still just 256 levels for each channel.

 

Wikipedia:

 

""32-bit color" is generally a misnomer in regard to display color depth. While actual 32-bit color at ten to eleven bits per channel produces over 4.2 billion distinct colors, the term “32-bit color” is most often a misuse referring to 24-bit color images with an additional eight bits of non-color data (I.E.: alpha, Z or bump data), or sometimes even to plain 24-bit data."

 

Then we have the 16-bits per channel formats, offering 65,536 colors per channel, but they are still using integers.

 

Then we have the EXR formats, which also have 16 or 32 bits per channel, but they are completely different because they do not use integers, but rather floating point and they do that in a very clever way.

 

I recommend a very nice book on the subject - The HDRI Handbook. I'm reading it for the second time and I have to confess, I still don't get all the details!

 

Of course, with HDRs, you then need to tone-map the image, because the display cannot show the full range anyway. My Samsung has a contrast ratio of 800:1 according to the specs. It's probably this issue of dynamic range that's making everyone seeing different amounts of banding in my screenshots. In fact, I don't know how much sense it makes to buy a very good display, if the goal is to make your images look nice on the client's display :)

Link to comment
Share on other sites

Yes, I was also of the impression that you could never see the difference on your monitor between an 8 bit, 16 bit and 32 bit image. The reason you use those higher ones is because you want the data held therein, not because you can actually see the difference. That is, if you're using a 32 bit HDR, you want those values above 1, even if you can't see it. And if you're using a Z-Depth over a large area to use to power a depth blur, you might use a 16 bit image otherwise - with only 256 variants of colour, that might mean that, over a 1 km landscape, each pixel corresponds to about 4 metres, which obviously is a problem... However, using a 16bit image allows you to have a pixel for each 1cm in the same scene, even if you can't see the difference when just looking at the bitmap of the z-depth.

Link to comment
Share on other sites

Good point!

 

I realized just couple of days ago the importance of "increased" bit depth for Z-depth while reading about these things! Must be put to use next time I need a depth map.

 

I'm still puzzled how this turned out to be a matter of displays. I would have imagined that such visible banding effects are a thing of the past by now and that saving in EXR would make my color transitions nice and smooth on any average display.

 

Oh well, I'm rendering the original living room scene again today, with higher settings and resolution. I'll see if it comes out as "banded" as the first attempt.

Link to comment
Share on other sites

I'm still puzzled how this turned out to be a matter of displays. I would have imagined that such visible banding effects are a thing of the past by now and that saving in EXR would make my color transitions nice and smooth on any average display.

 

Aah, but that's where the tricky word-smithery of the display industry comes into play. When they say a monitor has 32 bit colour (or 24bit if they're being slightly less cheeky), what they mean is 24/32bit TOTAL. When we say an 8 bit image, we mean 8 bits per channel.

 

Techy garble warning: 8 bits = 8 digit long binary number. The highest value this can represent (1111 1111) is equal to 255. Add to that the 0 (aka black) and we have a channel that can represent 256 variations of brightness. This is the case for the R, G and B channels, giving us a grand total of 24bits with a total of (256x256x256) = 16,777,216 different colour combinations.

 

So, with what we call an 8 bit image, you have the red, blue and green channels. 8 + 8 + 8 = 24bit. Add an alpha channel and that's 32bit. So when a monitor says it can display 24 (or 32)bits, what it really means is it can display an 8bit-per-channel image.

 

When we make a 16bit image or 32bit image, again, what we mean is that it has that many bits per channel. So the total of a 16bit image with an R, G, B and A channel = 64bit. So you'd need a 64bit monitor before you could see the difference between the same image saved in 8bit mode or 16bit mode.

Link to comment
Share on other sites

> I'm still puzzled how this turned out to be a matter of displays.

 

"When I look at this image on my display it has banding even though there's tons of data there."

 

OK, so what is the display doing with the data? Chopping it down to where you can see banding. You can't tell a kindergartener to get you 1.2 pieces of pie. You have to be happy with interger pie until the kid hits fourth grade. Similarly, most displays are fully incapable of showing you all the fine gradations in you data.

 

The extra bit depth is also good for compositing. Blending lots of 8 bpc data can lead to visible banding.

Link to comment
Share on other sites

I know I'm jumping on this a bit late, but...

 

The 204B is a TN type display that does not support the full 8-bit-per-channel output from your computer. I've had similar issues with other Samsung TN displays (though I'm not sure I ever used a 204B, but the problems should be similar). I tried viewing your image on a low-end laptop display and saw minor banding, but on my good monitor I see none at all. Basically, the number of gray shades the lower end monitors are capable of displaying is less than the number of shades in the image file, so on your display you see banding where the monitor fails to display the shades that would be between the bands. (If it should go 1-2-3-4-5 but instead it goes 1-1-3-3-5, you see a sharper contrast in the changes.)

 

What you want to do is look at it in print, and also if you have the inclination and the budget get a display calibration kit and if you can, move up to an SPVA or SIPS type display, and of course for in-depth material read Jeff's color management chapter in the 3DATS Advanced To Expert book. If the monitor is very different from the printer, you get an unpleasant surprise when your bright, shiny render prints out dark and lifeless.

 

Many displays, and Samsung is one of the worse offenders, are overbright and push the blue channel to give the image a certain "pop" that in the eyes of the average consumer covers up other shortcomings. Picture the LCD TV section of a Best Buy - you see all these bright, high contrast images with a lot of blue in them, and the shopper say "oooh, shiny".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...