View topic - Lanczos filter

Lanczos filter

Post here tutorials and links to tutorials about YafaRay and other CG training material related to YafaRay

Lanczos filter

Post Wed Sep 12, 2012 12:25 pm

Lanczos is a new anti aliasing filter implemented in the last versions of YafaRay. A rendered image can be considered as a signal that varies over space. An anti-aliasing filter is used to restrict the bandwidth of such a "signal" to approximately satisfy the sampling theorem:

http://en.wikipedia.org/wiki/Sampling_theorem

Roughly speaking, it filters out rays that does not fit in the continuity and smoothness of the final image. However, an anti-aliasing filter is also a trade-off, particularly in high contrast areas. Some filters reveal more detail but they also produce more aliasing on high contrast areas such as highlights and visible area lights. This is particularly true for two filters whose functions have negative lobes, which are Mitchell-Netravali and Lanczos. Both are used to amplify detail, but both will amplify aliasing on high contrast areas as well, many times beyond any reasonably anti-aliasing strategy. Lanczos function negative lobe is bigger than Mitchell-Netravali with a final positive curve, therefore it will reveal more detail than Mitchell but it will also produce more aliasing on high contrast areas. The negative lobe means that Lanczos reverberates over the edges of the scene (objetcs, shadows, hightlights, texturing) which brings detail up.

Which one to use ?

The faster one but with the poorer results is Box, so it is recommended for tests. Gauss is the "perfect" filter when you can reveal detail by just using a very big imagen resultion and/or you want to keep your highlights aliasing in check, for instance when you are doing studio lighting of a car with arealights and lot of mirror component. Gauss also blurs montecarlo noise a bit. Mitchel and Lanzos are used to reveal and amplify detail on images which have little or no high-contrast areas and therefore diffuse components prevail.

A comparison of filters with images:
https://de.wikipedia.org/wiki/Rekonstruktionsfilter

.
Attachments
700px-Lanczos_Filter.svg.png
User avatar
Samo
 
Posts: 3086
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Lanczos filter

Post Wed Sep 12, 2012 9:09 pm

A comparison of the exposed before
Notice the high-contrast aliasing around car lights in Lanczos case (click to enlarge).
Attachments
aafiltercomp.png
User avatar
Samo
 
Posts: 3086
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Lanczos filter

Post Thu Sep 13, 2012 6:36 am

Another comparison
Notice detail in door step (click to enlarge).
Attachments
AAfilterscomp2.png
AAfilterscomp2.png (320 KiB) Viewed 9976 times
User avatar
Samo
 
Posts: 3086
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Lanczos filter

Post Thu Sep 13, 2012 8:48 am

Thank you very much samo for the great documentation! :)
Arquitecto can be contacted here:
Arquitectos
Arquitecto
 
Posts: 249
Joined: Mon Jul 27, 2009 8:42 am
Location: Portugal

Re: Lanczos filter

Post Fri Sep 14, 2012 10:57 pm

Since mitchell and lanczos filters seem to produce a fairly similar result, are there any specific use cases where one should prefer to use lanczos over mitchell?

I only briefly tested lanczos a long time ago, but I seem to remember wanting to stick with mitchell for some reason.
User avatar
wizofboz
 
Posts: 235
Joined: Tue Sep 16, 2008 7:00 pm

Re: Lanczos filter

Post Sat Sep 15, 2012 3:19 am

wizofboz wrote:Since mitchell and lanczos filters seem to produce a fairly similar result, are there any specific use cases where one should prefer to use lanczos over mitchell?

I only briefly tested lanczos a long time ago, but I seem to remember wanting to stick with mitchell for some reason.


in theory, Mitchell is the best and Gauss is the second best option to get good results, and pixelwidth =1.5 is theoretically the best value for all the anti alisaing filters in Yafaray. Using the same pixelwidth value, lanczos produces better results than the other filters in scenes with lot of small details, but at the same time it's more prone to Moire.

from Blur to Sharp:

Gauss (it blurs small details) - Mitchell (best visual compromise between blur and sharpness) - Lanczos (sharp, prone to Moire)

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Re: Lanczos filter

Post Sat Sep 15, 2012 5:19 pm

I find Lanczos produces aliasing in areas such as high contrast diagonals, and prefer to use Mitchell when I need sharp results.

That may be my fault for using too much contrast :)
User avatar
stoneage
 
Posts: 1240
Joined: Sun Dec 23, 2007 1:06 pm


Return to Tutorials & Learning Resources



Who is online

Users browsing this forum: No registered users and 2 guests

cron