See around https://github.com/matplotlib/matplotlib/blob/88f53b12e1443a9ae046ee55d1f1d6c3391eff22/lib/matplotlib/image.py#L392-L542 and https://github.com/matplotlib/matplotlib/pull/17636https://github.com/matplotlib/matplotlib/pull/10613https://github.com/matplotlib/matplotlib/pull/10133

Where the issues tend to show up is if you have enough dynamic range that the small end is less than difference between adjacent representable numbers at the high end e.g.

In [5]: 1e16 == (1e16 + 1)
Out[5]: True

In some cases the scaling / unscaling does not work out the way you wish it would.  While it is possible that the issues we are having are related to what we are doing with the results, forcing to [0, 1] restricts you to ~15 orders of magnitude on the whole image which seems not ideal.  While it may not be common, that Matplotlib got those bug reports says we do have users with such extreme dynamic range in the community!

That said, if you see any obvious things Matplotlib is doing wrong please let us know!

Tom

On Fri, Jul 23, 2021 at 7:42 PM Stefan van der Walt <stefanv@berkeley.edu> wrote:
Hi Tom,

On Fri, Jul 23, 2021, at 14:08, Thomas Caswell wrote:
I would caution about restricting to the [0, 1] range in the functions.  Internal to imshow in Matplotilb we are currently doing this rescaling (because we are using Agg to do some resampling for us) and it has caused a fair amount of trouble, particularly in images with large dynamic range.

I was trying to come up with a case where this would cause problems.  Do you happen to have examples?

Best regards,
Stéfan

_______________________________________________
scikit-image mailing list -- scikit-image@python.org
To unsubscribe send an email to scikit-image-leave@python.org
https://mail.python.org/mailman3/lists/scikit-image.python.org/
Member address: tcaswell@gmail.com


--
Thomas Caswell
tcaswell@gmail.com