Dplug
Dplug copied to clipboard
UIImageKnob, store 2 downsampled source image in KnobImage
Perhaps the resizing algo is now a bit too aggro for Diffuse map. Best see in macOS, Auburn Sounds latest thing, PBR diffuse has slight halos. It has a blurry and "detached" look.
(EDIT: actually very annoying)
I think this is instead due to UIImageKnob resampling twice. Slight blurry feel on Inner Pitch, the big knob on rotated knob, since it's resampling once for storing the image, and another one for displaying it. Wasteful!
-
[x] Is the issue the fact we sample twice or the fact we sample the second time without consideration for being alpha-premultiplied? => but interpolation already works correctly for premultiplied, instead it is incorrect for unassociated alpha.
-
[x] Visual test. Linear interp on original image doesn't win particularly against a resized, cubic-interpolated, oversampled, temp image. In particular the problematic halos are still there, not really understood.
-
[ ] New method is shifted of (-0.5, -0.5), what is the correct sampling point? A separate issue.
-
[x] What if we also use cubic interpolation? =>effectively sharper, need to see on use vs baseline. Still doesn't solve white halo, and smaller size are aliased.
- direct sampling noticeably faster on resize and first opening, reflow does nothing there.
- memory usage? 14% memory gain on Inner Pitch (10.5mb saved per instance)
- does it beat original-without-oversampling at normal sizes? Interesting. The oversampled original has that "remote" look and feels detached from the UI, a bit blurrier. The new method has a bit more aliasing artefacts but feels more real.
-
[x] test on larger screen => method would need x2 or x4 reduced images to be really cool. mipmap reduced would be based upon scale factor.
-
[ ] Alternatively we could store downsized version of the source image in KnobImage, that makes one mipmap precompute instead of resizing UIKnobImages all the time. But: still a case of double-interpolation for smaller sizes, which seems OK.
In A/B unclear who wins between 1.3 oversampled baseline, vs direct cubic sampling. and for smaller size it's worse so we need resampling for smaller sizes.
Proper fix for that is:
- [x] to find real reason for white halo => #825 (very old issue actually)
- [ ] Put a Mipmap (or collections of 3 images) of high-quality (better than we have) in KnobImage, so that resize and multiple widgets don't store their own version. Probably just 2 downsampled levels are sufficient in addition to level 0. That wins the additional CPU on resize, the memory per-widget, with a bit of additional quality when size is not far from original (but, upsampled might look a tiny more pixelated, but assets should be done at max res)