Quote |
---|
(...) the main issue of histogram-based image filters is how to choose number of historgram "bins" (i.e. levels of discretization). It's incorrect to use the same number of bins for images with different RGB value ranges, isn't it? |
With 8 bpc images there is not much doubt, here you can represent all values with direct correlation btwn value and index - but how did you handle histogram building with floating point images earlier? I guess by clamping and mapping to 8 bit range.
The question is if the direct correlation btwn value and index is really needed: i.e. the bin at e.g. index 255 could represent another value than 255, say image maximum value, and the value at index 0 could hold the image minimum.
Since floating point images are likely to contain lots of almost, but not equal values, some sort of weighted approach is needed for all intermediate values, as they probably will not match the index value for a given bin. When adding intermediate values that are not in direct correlation with an index, the values could be added with a weight to the two nearest entries.
Anyways - its just an idea, I haven't tested it in a real implementation yet. I'm also curious about another approach: sort each channel in the image and consider the result as a 1D array, resample that array down to the wished final table size. This should represent some sort of histogram, but I'm not sure about the actual mapping here..
Quote |
---|
BTW you question about Levels has given me an idea how to implement fully-hdr Levels |
That is great news! Specially if you also figure out how to HDRize Min./Max. Level
About HDR version of HSL adjustment:
I did some tests yesterday - this is indeed a tough problem, mainly regarding increase in saturation because "full saturation" is range dependent. Shifting hue: no problem, decreasing saturation: no problem, lightness: no problem, but increasing saturation.. can't figure out that one..