color depth question

I do a lot of graphics programming in my spare time. To make a long story short, I am considering upgrading my graphics routines to support more than 32-bit RGBA. The real question is how far to go.

Moving to 64-bit RGBA would be pretty straightforward but at double the memory cost. The only other practical option is floating-point (128-bits per pixel), which takes quadruple the memory but has more dynamic range. Floating-point is also more of a pain.

If you work decide to use 64-bit RGBA, then you have two options, using Half (16 bit float values), or UInt16. With Half you'll have a lower dynamic range but the math will be easier. With 128-bit RGBA, you'll use float, easy math, but you have to make sure your software runs in 64 bits platforms.

If you work decide to use 64-bit RGBA, then you have two options, using Half (16 bit float values), or UInt16. With Half you'll have a lower dynamic range but the math will be easier. With 128-bit RGBA, you'll use float, easy math, but you have to make sure your software runs in 64 bits platforms.

When it comes to the math, I wonder how low level we're talking about here. There are operations that are extremely dependent on conditioning or that can cause problems if misused. For example it's not immediately evident when subtraction goes wrong in floating point math. You may end up with a non-zero value that still scales into something that appears meaningful.

Quote:

Originally Posted by andrewrodney

What's the final output?

Final output may not actually matter. The issue he mentioned of dynamic range could be just for intermediate stages, which is totally valid. He somehow considered 128 bits per pixel, yet not half precision floats (as pixaerio mentioned) without specifying a reason for this. They're unknown implied constraints, which is why I suggested rewriting it.

I'm working on an open-source painting app that I want to add layering support to, and thought maybe it would be wise to go ahead and increase the color precision before implementing those changes. But now I'm not so sure, and will probably just do the layers and forget about it.

Moving from 32-bit to 64-bit integer RGBA is a possibility, as it would come almost for free on 64-bit platforms. (PNG also supports this format directly.) But is it worth it? There are some occasional color banding issues but maybe not enough to justify an overhaul?