You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to ask / recommend to add support for inf values.
Currently, inf values are hiding the information in the image, and cannot be seen using the normalize function,
The image would appear completely black, even after using the normalization button.
The value range for float types is expected to be between 0.0 and 1.0, so in your case all pixels should be white (above the maximum value of 1.0).
In the case of normalizing the image, I think the correct way would be to show all inf values as white, while all other values get squished towards 0 (black).
You said even without normalization the image gets displayed as black? Could you share a reproducible code sample?
Okay, what would be your desired behavior when normalizing arrays with inf values?
In my opinion the correct behavior would be to display inf values as white and everything else as black. That would be consistent with the idea of rescaling all values into the value range (0.0, 1.0).
I think the correct behavior should be not to miss the other values (visually) even when inf's are in the image.
So when using the normalization function - if the inf's are white, all the other values should be colored according to their gray level to allow them to be seen.
I think that would make sense but the user might miss that there are infinite values in there like this. An alternative would be to make infinite values appear transparent. Maybe the best way would be to make this an option so the user can decide which behavior is best for them.
Yes, any extra visualization technique for those inf's is even better.
Another edge-case to consider is a binary image with inf's. (if those inf's are either black or white - we might miss them)
Thanks for your wiling to keep making the amazing PixelLens even better !
Activity
srwi commentedon Jul 31, 2025
Mh, I'm not sure about this. In the case of non-normalized displaying it behaves as expected:
The value range for float types is expected to be between 0.0 and 1.0, so in your case all pixels should be white (above the maximum value of 1.0).
In the case of normalizing the image, I think the correct way would be to show all
infvalues as white, while all other values get squished towards 0 (black).You said even without normalization the image gets displayed as black? Could you share a reproducible code sample?
CallShaul commentedon Jul 31, 2025
Here when it fails to normalize:
(values are NOT in the range of 0-1, without the inf's - normalization works well outside of the 0-1 range, but not with the inf's)
srwi commentedon Jul 31, 2025
Okay, what would be your desired behavior when normalizing arrays with inf values?
In my opinion the correct behavior would be to display inf values as white and everything else as black. That would be consistent with the idea of rescaling all values into the value range (0.0, 1.0).
CallShaul commentedon Jul 31, 2025
I think the correct behavior should be not to miss the other values (visually) even when inf's are in the image.
So when using the normalization function - if the inf's are white, all the other values should be colored according to their gray level to allow them to be seen.
Maybe something like this:
srwi commentedon Jul 31, 2025
I think that would make sense but the user might miss that there are infinite values in there like this. An alternative would be to make infinite values appear transparent. Maybe the best way would be to make this an option so the user can decide which behavior is best for them.
Thank you for your feedback!
CallShaul commentedon Jul 31, 2025
Yes, any extra visualization technique for those inf's is even better.
Another edge-case to consider is a binary image with inf's. (if those inf's are either black or white - we might miss them)
Thanks for your wiling to keep making the amazing PixelLens even better !
All the best.
srwi commentedon Jul 31, 2025
You're right. In that case maybe transparency would be the more suitable default.