Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Hello devs,
Is there any plan to add high tap (lobe) count Spline filters and the EWA version of them?
Spline filter I refer here is the one you can find in mpv (Spline36/64) or you can use with ffmpeg's -vf zscale.
I think a typical result of spline36/64 resizing is as sharp as Lanczos and has less ringing and halo artifacts.
Here's an example script for spline36 resizing in the linear space using IM and ffmpeg's -vf zscale.
(you need "zimg" library and --with-zimg configured build of ffmpeg to use "zscale" filter: https://github.com/sekrit-twc/zimg)
I know that (and spline w/ custom defined lobe count is exactly what I want to use on IM), but the result I get is full of ringings and halos if I use high lobe count Lanczos (2-lobed one is the safest IMHO). When I resize an image on IM, I rather use -distort resize with the default Robidoux filter (as sharp as 2/3 lobed Lanczos & less artifacts).
Do you have any comparisons of the tap filter vs what you feel is the best that Imagemagick can do that shows it is superior? If you have any tests, please provide them.
If you want sharpness, try the cartrom or Lagrange filters (at the expense of other artifacts).
Is the tap filter useful for both shrinking and enlarging or is it best for only one? Is it limited to integer factors?
Do you really need all the very high tap count filters? Don't you find diminishing returns? At what tap count do you find quality vs time cost levels off?
fmw42 wrote: ↑2017-08-13T15:16:39-07:00Do you have any comparisons of the tap filter vs what you feel is the best that Imagemagick can do that shows it is superior? If you have any tests, please provide them.
The difference is subtle. Lanczos is a bit more sharp, but produces artifacts a bit more. I'll probably post some comparison pictures later (rose, LOGO, WIZARD, etc.).
fmw42 wrote: ↑2017-08-13T15:16:39-07:00Is the tap filter useful for both shrinking and enlarging or is it best for only one? Is it limited to integer factors?
It's fine for both shrinking and upscaling and it works with any factor (EDIT: I meant it's not limited to integer), although EWA filters are better than the tensor Spline36 for upscaling.
fmw42 wrote: ↑2017-08-13T15:16:39-07:00Do you really need all the very high tap count filters? Don't you find diminishing returns? At what tap count do you find quality vs time cost levels off?
I guess the 3-lobed one is the most balanced for quality vs time, and processing cost wise, it should be identical to Lanczos3.
Whoops, the graphs aren't my work (it's not my page).
The term tap was inappropriate actually. I meant lobes.
Number of lobes vs number of reference samples is the same as Lanczos: (2n)^2 [n=lobes]
2-lobed Spline = Spline16: (2*2)^2=16
3-lobed Spline = Spline36: (2*3)^2=36
4-lobed Spline = Spline64: (2*4)^2=64
...
But I guess the current Spline filter available in IM is B-Spline, and I don't know if it makes sense to have B-Spline, Spline and Lanczos in a single software.
I have tested the following minimizing tests in IM 7.0.6.8beta and visually see no difference. A compare does show minor differences of the order of about 0.8% or less with respect to lanczos. But I cannot tell if the spline filters are better or worse.