pls credit algorithm/code originators
Please credit algorithm/code originators. (I understand that FLOSS devs have other things to do than figure out who to credit, and also that some of what's in libplacebo was taken from mpv etc. I'll probably bug the mpv people at some point.)
original libplacebo derivation of the Lanczos4Sharpest (de)blur
and
libplacebo highest precision derivation of the Lanczos4sharpest (de)blur
are higher precision ports of my
final (for ImageMagick) derivation of the Lanczos4Sharpest (de)blur
and
earlier (for ImageMagick) derivation of the Lanczos4Sharpest (de)blur
Note:
Lanczos4Sharpest is a method I formulated. Anthony Thyssen spurred my investigation of optimal values for the (de)blurring of EWA kernels and through his feedback helped guide it toward useful results so maybe he should be co-credited for some or all of my EWA stuff (e.g. EWA Lanczos2Sharp and EWA Robidoux should probably be credited to both N. Robidoux and A. Thyssen).
What this code does is enforce the following conditions:
The following conditions are equivalent if the support of the EWA jinc-windowed jinc (or whatever EWA) is not truncated (I am pretty sure that 3 taps is enough with the obtained (de)blur for 4-lobe jinc when upsampling, even more so under 'no-op').
a) Among alternatives, the (de)blur (scaling of the support of the kernel) makes the resulting 'no-op' convolution minimize the difference with the identity w.r.t. the L-infinity linear operator norm.
b) Under 'no-op', the weight of the center pixel is 1 after normalization.
c) Under 'no-op', the sum of the other (non center) pixel weights is 0 (before or after normalization, no matter).
d) Under 'no-op', the deviation of the normalized weights from Kronecker delta averages to 0. (Equivalently, it's a minimizer of the deviation in L2-norm.)
Fine print: For a) - d) to be equivalent, the (de)blur must not be too large. The equivalence is "local", that is, near (de)blur = 1, that is, no (de)blur. Full equivalence may require some uninteresting additional fine print.
libplacebo high precision derivation of the LanczosSharp (de)blur
is a higher precision port of my
final (for ImageMagick) derivation of the (robust to truncated support) LanczosSharp (de)blur
Note:
EWA LanczosSharp is a method I formulated.
What this code does is enforce the following condition:
A) Among alternatives, the (de)blur makes the contributions of 1-pixel away (nearest) horizontal or vertical lines (value must be constant along each line) vanish under 'no-op'.
Fine print: This condition is more robust to modest truncations (not scaling: I mean dropping some of the outer values because you don't use enough taps) of the support of the EWA jinc-windowed jinc (or whatever EWA) than the above a)-d). However, with 3 taps as used by libplacebo, I would suggest that you use the 1D version of a)-d) instead of A) because 3 taps is plenty to preserve the full support. I'll address this in a different post. It does not make a huge difference in the (de)blur: makes it just a bit larger (hence the filter is a tiny bit more smoothing). On the other hand, it could be that A) works better when there is an odd number of lobes, even more so when odd means 3.
Generally,
seems to owe quite a bit of pieces to
which is an acknowledged descendant of Heckbert's Zoom. Some of it may just be that "everybody ended up doing the same things" but not all.
libplacebo colorspace.c which implements sigmoidization
AFAIK, the sigmoidization method (resampling through a sigmoid "color space") was invented by yours truly:
Anthony Thyssen's discussion of sigmoidization in the legacy ImageMagick documentation
Libplacebo even uses Anthony Thyssen's favorite "slope" = 6.5 (based on math heuristics, I initially tended to prefer higher values; Anthony used his eyes).
In addition, I immediately realized that sigmoidization probably could benefit from being applied to a luminance channel instead of everything:
N. Robidoux's post stating that sigmoidization should probably be used on luminance
AFAIK, Mathias Rauen (madshi of madVR) was the first one to successfully make EWA whatever-with-negative-lobes benefit from AntiRing. I think he should be credited as the originator.
AFAIK, EWA texture mapping's way of scaling the jinc-windowed jinc kernel when upsampling was first fixed by Andreas Gustaffson in his 1993 Masters thesis. I made the link with QR decomposition (he used an SVD). Both are trivial when resizing (the overall result is that you should not scale the support of the 1-to-1 kernel when upsampling the way you should when downsampling, which is not as obvious as it would seem it should be when EWA is taken from splatting).
AFAIK, separable 3-lobe jinc-windowed sinc a.k.a. Ginseng (my own stupid pun) is something I formulated (this is the most accessible and informative reference; I formulated and advocated for it even earlier):