Page 1 of 1
Tensor Parzen?
Posted: 2012-10-15T14:21:27-07:00
by BryantMoore
I was playing around and this seems to be a really good filter, particularly with sigmoidal contrast in linear RGB.
Standard Parzen
Parzen with Linear RGB and Sigmoidal Contrast of 8 (Maybe this could be lower?)
Mitchell for reference
Generated using this script.
Code: Select all
#!/bin/sh
for f in blackman box catrom cubic gaussian hamming hann hermite kaiser lanczos mitchell parzen point quadratic sinc spline triangle;
do
#magick rose: -sample 1000% -define filter:blur=10 -define filter:filter="$f" -resize 100% -quality 9 10xrose-"$f"-conv.png
#magick rose: -define filter:filter="$f" -resize 1000% -quality 9 10xrose-"$f".png
magick rose: -colorspace rgb +sigmoidal-contrast 8 -define filter:filter="$f" -resize 1000% -sigmoidal-contrast 8 -colorspace srgb -quality 9 10xrose-"$f"-lrgb-sig8.png
done
What I like is that it doesn't suffer from ringing like a lot of filters while also being free from aliasing. I'm not an expert on filters so maybe someone else could clue me in on why that is.
Re: Tensor Parzen?
Posted: 2012-10-15T21:18:49-07:00
by anthony
If you check the graph of the windowing functions...
you will see that parzen has the largest roll off of all the filters, which is why its negative lobe is so minimal.
Remember windowed filters, (like lanczos) or a equivelent, (like mitchell) is better suited for reducing image size, rather than enlargement. For major enlargement what should be used really depends on what aspect you are waning from the enlargement.
For enlargement having a fast roll-off is good, but you may be better off using an interpolative filter instead. For example Hermite, a interpolative-Gaussian (smaller sigma). Neither of which has any negative lobe to them. Mitchell and other Keys Cubic filters will trade blurring (extreme is Spline) for Sharpness (extreme is Catrom).
I suggest you read the filter section and try to understand the various filters. Comments on the explanations are welcome. I tried hard to make it understandable without using any heavy mathematics and Fourier frequency analysis.
Re: Tensor Parzen?
Posted: 2012-10-21T09:10:19-07:00
by NicolasRobidoux
I myself like Parzen windowing a lot. I considered including it in "The Recommendations" (used to window EWA Jinc 3-lobes, it actually appeared in an unpublished draft). But it did not quite make the cut.
Maybe I'll have a second look.
There is a mathematical basis for "liking" Parzen-windowed Sinc 4-lobe:
Windowing approximates pre-filtering. Windowing a 4-lobe Sinc with Parzen approximates pre-filtering with cubic-B spline smoothing with frequency response set so that it low passes at exactly half the usual soft cut-off.
Re: Tensor Parzen?
Posted: 2012-10-21T09:20:14-07:00
by NicolasRobidoux
And yes, such pre-filtering would be a good fit with sigmoidization, and I myself would use a slightly lower contrast.
Re: Tensor Parzen?
Posted: 2012-10-21T09:20:45-07:00
by NicolasRobidoux
Second look: it's too blurry.
The above explanation actually says why: The pre-filtering is even more blurring than standard cubic B-spline smoothing.
Although I agree that sigmoidization makes up for it somewhat.
Re: Tensor Parzen?
Posted: 2012-10-21T09:31:17-07:00
by NicolasRobidoux
Third look:
Indeed almost good enough.
It's going on my list of schemes to test carefully.
-----
Thank you Bryant. Very much.
Re: Tensor Parzen?
Posted: 2012-10-21T09:37:14-07:00
by NicolasRobidoux
It's very nicely anti-aliased, and yet it is an interpolatory method.
I'll also have to have a look at tensor Quadratic-windowed Sinc 3-lobe, which follows the same mathematical logic.
Code: Select all
-define filter:window=Quadratic -define filter:lobes=3 -resize
Re: Tensor Parzen?
Posted: 2012-10-21T10:03:15-07:00
by NicolasRobidoux
Of course, one test image does not a winner make. But this is promising.
Re: Tensor Parzen?
Posted: 2012-10-21T10:15:00-07:00
by NicolasRobidoux
Yes, definitely a good partner for sigmoidization.
No time for this now, but I'll have to do a "full check".
Re: Tensor Parzen?
Posted: 2012-10-21T12:51:06-07:00
by NicolasRobidoux
Re: Tensor Parzen?
Posted: 2012-10-21T15:37:15-07:00
by BryantMoore
Nicolas, it seems windowing Parzen with Sinc gives it a touch of added sharpness, a sigmoidal contrast of 6 seems to also tighten up the edges just enough to add some further definition.
Code: Select all
magick rose: -colorspace rgb +sigmoidal-contrast 6 -define filter:window=sinc -define filter:filter=parzen -resize 1000% -sigmoidal-contrast 6 -colorspace srgb rose.png
Code: Select all
magick rose: -colorspace rgb +sigmoidal-contrast 6 -define filter:filter=parzen -resize 1000% -sigmoidal-contrast 6 -colorspace srgb rose2.png
Re: Tensor Parzen?
Posted: 2012-10-21T15:50:55-07:00
by NicolasRobidoux
Bryant:
Remember: You can't judge a scheme from one single test image and enlargement ratio, and the "rose" is "special".
I did a quick compare, and at this point I still prefer other schemes.
But indeed it is a solid one, and for this reason I added to the next update of "The Recommendations" a written note that Parzen works well with 4-lobes. (And yes: It's better with tensor Sinc and EWA Jinc. My quick back of the envelope jottings don't always land right.)
Thank you.
Re: Tensor Parzen?
Posted: 2012-10-21T16:09:56-07:00
by NicolasRobidoux
Right now, I prefer tensor Quadratic-windowed Sinc 4 over tensor Parzen-windowed Sinc 4, for example.
This opinion may change, however.