colors - Fast approximate algorithm for RGB/LAB conversion? -
i working on data visualization tool using opengl, , lab color space comprehensible color space visualization of data i'm dealing (3 axes of data mapped 3 axes of color space). there fast (e.g. no non-integer exponentiation, suitable execution in shader) algorithm approximate conversion of lab values , rgb values?
if doing actual conversion calculation in shader complex/expensive, can use lookup table. since both color spaces have 3 components, can use 3d rgb texture represent lookup table.
using 3d texture might sound lot of overhead. since 8 bits/component used represent colors in opengl, need 256x256x256 3d texture. @ 4 bytes/texel, that's 64 mbyte texture, not outrageous, substantial.
however, depending on how smooth values in translation table are, might able away lower resolution. keep in mind texture sampling uses linear interpolation. if piecewise linear interpolation enough base-resolution of lookup table, can reduce size.
if go direction, , can't afford use 64 mbytes lut, you'll have play size of lut, , make possible size/performance vs. quality tradeoff.
Comments
Post a Comment