Re:What every coder should know about gamma
by elbows on Thursday September 22, 2016 @09:12AM
(#12556561)
16-bit integers are good enough for most image-processing algorithms. But you have to code pretty careful to avoid overflow or loss of precision in your intermediate values.
Floating point is much easier to work with, and sometimes makes a difference with quality. On modern CPUs it's also about as fast as integer processing, if not a bit faster sometimes.
On GPUs, it might actually be the other way around -- image processing tasks tend to be limited by memory bandwidth, so you might get better performance with 16-bit integers. But I haven't tried it.
Re:What every coder should know about gamma
by johnnovak on Thursday September 22, 2016 @06:12AM
(#12555763)
Yes, we need greater precision, ideally floats, but maybe 16 bits would be enough (haven't tested this or thought much about it.) But for multiple passes of processing floats are definitely the way to go due to rounding errors. I don't think you'd get worse performance when using floats on current hardware.
I guess that that the required number of bits to encode physical intensity values depends on the operations. performed. The author suggest using floats, but this means 3x4 bytes and 4x4 bytes with the alpha channel. Would 16 bit unsigned integer be enough ? Floats are ok when using graphic cards, but not ok when using the processor.