# How does anti-aliasing work in cycles?

As far as I understand, cycles anti-aliasing in cycles (per default), works by sampling around a specific arc/vector determined by the camera position/rotation.

This explanation and my experience lines up with the answer here https://blender.stackexchange.com/a/3554/245 but kind of disagrees with the explanation given in https://blender.stackexchange.com/a/17845/245 specifically the image https://i.stack.imgur.com/irhyB.png describing sampling.

If sampling is working this way, the image will always be anti-aliased.

So my understanding for sampling is as follows

Where the radius of the circle is the width of the width value of the "pixel filter" in the UI.

This would mean however, that either not all the space is sampled or the sampled space overlaps (thus blurring the image) and the only way to get high quality (super-sampling) anti-aliasing is to manually render at increased resolution and downsample the image later. Is there a way around this?

• > and the only way to get high quality (super-sampling) anti-aliasing is to manually render at increased resolution and downsample the image later. Is there a way around this? So my understanding of what you want it to get a really high quality render of an image? One free of less than stellar poorly done anti aliasing and to my knowledge I'm afraid there is no work around from what you have described I'm afraid. You're just going to have to have a render the scene at a large resolution and then downsample it later as you described. Also it wouldn't hurt to bump of the samples a ton but of cou Jun 7, 2019 at 7:15
• filter_func_blackman_harris and filter_table are implemented in developer.blender.org/diffusion/B/browse/master/intern/cycles/… and cdf functions in developer.blender.org/diffusion/B/browse/master/intern/cycles/… developer.blender.org/diffusion/B/browse/master/intern/cycles/… Jul 23, 2019 at 22:05

tldr: The default anti-aliasing setting samples significantly outside one pixel which reduces the effective resolution. For a maximum effective resolution use the "box" setting which acts as an incredibly high multisampling anti-aliasing filter.

From my own experiments and the information provided in the discussion from the patch https://developer.blender.org/D1453, the sampling with the Blackman-Harris-Filter happens in a circular pattern around the center of the pixel, with the density following the Blackman-Harris-Distribution.

In the default case, with a "filter width" of 1.5 pixels, this means that up to 5 pixels in a horizontal line contribute to the central (third) pixel. Not only the nearest neighbor but also the next nearest neighbor pixels. This leads to a significant "blurring" of the image. Only "filter width" values below ~.65 pixels guarantee sampling stays within the original pixel. This however leaves out the corners of the pixel.

Chosing an "optimal" default and distribution is not possible as per wikipedia:

The goal of an anti-aliasing filter is to greatly reduce frequencies above a certain limit, known as the Nyquist frequency, so that the signal will be accurately represented by its samples, or nearly so, in accordance with the sampling theorem; there are many different choices of detailed algorithm, with different filter transfer functions. Current knowledge of human visual perception is not sufficient, in general, to say what approach will look best.

However what originally motivated me to post this question, was the blurring when working with pixel accurate sprites. With the default anti-aliasing setting it felt like detail got lost in the renders. However turning off or reducing the width of the filter too far killed the anti aliasing even inside the pixels.

When using the "box" anti-aliasing filter and adding a Gaussian blur in the compositor, I can no longer distinguish the results from the Blackman-Harris filter, but I have the freedom to adapt the sharpness in after the render.