make ImageItem combine levels + lut not be a pessimization#1668
make ImageItem combine levels + lut not be a pessimization#1668pijyoi wants to merge 4 commits intopyqtgraph:masterfrom
Conversation
|
Got a little concerned with the failure for test_ImageView, but looking at the CI history, I can see its failed before. |
|
I have tried to restore the behavior to pre-#793, that is to say, levels-only is converted to lut-only. i.e. VideoSpeedTest.py --size=3072x3072 all the following cases bypass levels and applies lut only This would also allow us to drop the fits_int32 specialization in #1648. |
|
Timings on a Linux machine with numpy 1.20.2 python examples/VideoSpeedTest.py --size=3072x3072 --levels=50,200 python examples/VideoSpeedTest.py --size=3072x3072 --levels=50,200 --lut |
I'm going to have to defer to @outofculture and @campagnola for input here. Right now we have our hands full with writing a submission for a conference; so it might be a few days before you get helpful follow up. My stance regarding #793 behavior is that ideally the issue presented in #792 (where |
This reverts commit 83d09f2.
previous value : (lut.shape[0]-1) / levdiff new value : lut.shape[0] / levdiff this distributes the range of values evenly across all lut bins
No worries.
I made the first 2 commits erroneously thinking that issue #792 didn't apply to integer data. It looks a bit kludgy, the part that calls makeARGB() with a specially chosen scale value in order to cause apply levels to be bypassed. |
|
development continued in #1693 |
This PR continues #1630 in trying to fix the pessimization identified in #1590
Cases tested with PYQTGRAPHPROFILE=functions.makeARGB:
#1630 fixed cases 1,2,5,6
This PR fixes cases 3,4,7,8
It would good to take a look at #792 and #793 to get context on what this PR is working around.
What this PR does is to explicitly supply a
scaleargument with a specific value tomakeARGB()such thatmakeARGB()does not use its own default. This causes rescaling to be bypassed, which was the intention of combining levels + lut in the first place.