mediapy icon indicating copy to clipboard operation
mediapy copied to clipboard

Setting vmin to a value greater than 0 can produce unexpected results for unsigned integer types

Open danbgoldman opened this issue 2 years ago • 0 comments

Since to_rgb simply subtracts vmin from array, low pixels can underflow to high values, producing unexpected results.

I think it should be simple to fix: upcast array to int32 before subtracting vmin, and clamp to zero afterwards. But I haven't thought through edge cases.

danbgoldman avatar Sep 03 '22 01:09 danbgoldman