<p>Imagine that one is rendering a picture of a flat floor with a uniform black and white checkerboard pattern that extends to the horizon; the checkers are large enough that they should be clearly visible at points near the camera but not large enough to be distinguishable near the horizon.</p>

<p>Near the horizon, the floor should simply appear as uniform gray.  Near the camera, the checkers should appear distinct.  Between the camera and the horizon the appearance of the floor must somehow transition between those two extremes.</p>

<p>If the scene is rendered a spacial filter that has a very sheep cut-off, there will be a certain distance where the floor goes from being checkered to being gray.  If one uses a shallower filter, the transition will be much more gradual, but things near the original "cut-off" distance will be less sharp than they would have been otherwise.</p>

<p>If one were to add a "wall" or crop the scene to hide the distant parts of the floor, such that there was no need to have any parts of the checkered floor blurred to gray, the best results would be obtained by using the steepest filter, yielding the sharpest image.  Using a shallower filter would give up image sharpness for the purpose of preventing a nasty transition that wasn't going to be visible anyway.</p>

<p>Figuring out what kind of filtering to use thus requires that one know something about the spacial frequency content of the information to be displayed.  If the image contains nothing of interest that would approach Nyquist, using a steep filter will produce the sharpest results.  If, however, image content exceeds Nyquist, using a gradual filter will avoid ugly "transitions".  No single approach will be optimal for all cases.</p>

CC BY-SA 3.0
2016-03-25T21:41:43.557Z
2016-03-25T21:41:43.557Z
supercat
<p>In my opinion and experience i don't think there exists an univocal answer... since basically in literature you can easily find example of adaptive filters too (i.e. of variable size). </p>

<p>I think the actual answer should be related to the both context of applications (i.e. hardware or sofware, real time or not) and kind of scene you're going to synthesize (some scenes usually involves different kind of aliasing when are synthetized (i use this general term on purpose)). Basically computer graphics is the study of algorithms and data structure for image synthesis, and such definition isn't stricly related to any kind of application.</p>

<p>Of course an important factor is even the goal to be achieved by a filtering process (i.e. not necessary an excessive blurring could be bad...).</p>

<p>If you're speaking of "nice to see" i think you could agree with me when i say that there's no specific measure of "pleasant image".</p>

CC BY-SA 3.0
2015-08-05T20:58:28.940Z
2015-08-05T20:58:28.940Z
user8469759
<p>I'm not sure that there's a truly <em>optimal</em> radius&mdash;it's going to be a subjective matter based on what the image looks like.  As you say, too large a radius results in blurring and too small a radius results in aliasing.</p>

<p>I like to set sigma = 0.5 px, so that the overall radius is about 1.5 px (since the Gaussian has the majority of its weight within ±3 sigma of its mean).  In my experience that gives a good trade-off between blurring and aliasing, but that's just my taste, not based on any objective considerations.</p>

<p>By the way, as part of <a href="http://www.reedbeta.com/blog/2014/11/15/antialiasing-to-splat-or-not/">a blog post on antialiasing</a> I wrote last year (which was based on an answer I posted on the previous incarnation of this site!), I tested a variety of antialiasing kernels against a synthetic test image and came out with 0.5 px Gaussian as my subjective favorite.</p>

CC BY-SA 3.0
2015-08-05T21:01:28.423Z
I remember that answer last time round :) (I was githubphagocyte back then). Interesting to see it expanded into a blog post.
trichoplax is on Codidact now
CC BY-SA 3.0
2015-08-05T20:52:43.003Z
2015-08-05T20:52:43.003Z
Nathan Reed
<p>Using a gaussian distribution of points on an image plane to calculate a pixel value, what radius/standard deviation will give the most information in the final image? Too large a radius gives a blurred image, and too small a radius neglects information that is smaller than a pixel so that it does not contribute to the final image. Where is the optimal compromise? Is there a single answer to this question or are there circumstances under which it can vary?</p>

<p>I'm thinking of this in relation to raytracing but I imagine it will apply equally to things like downsizing an image. Where the answers would differ, I am interested in what applies when sampling a continuous image plane, so that the positions of pixels in a larger image cannot be used to determine an optimal radius.</p>

<sampling><pixels>
What is the optimal radius of gaussian distribution for determining pixel colour?
trichoplax is on Codidact now
# What is the optimal radius of gaussian distribution for determining pixel colour?

(Asked by: username_0 on 2015-08-05)

Using a gaussian distribution of points on an image plane to calculate a pixel value, what radius/standard deviation will give the most information in the final image? Too large a radius gives a blurred image, and too small a radius neglects information that is smaller than a pixel so that it does not contribute to the final image. Where is the optimal compromise? Is there a single answer to this question or are there circumstances under which it can vary?

I'm thinking of this in relation to raytracing but I imagine it will apply equally to things like downsizing an image. Where the answers would differ, I am interested in what applies when sampling a continuous image plane, so that the positions of pixels in a larger image cannot be used to determine an optimal radius.

**Tags:** sampling, pixels


---

## 3 answers

### Answer by username_3 on 2015-08-05. Score: 7 | Accepted answer

I'm not sure that there's a truly *optimal* radius—it's going to be a subjective matter based on what the image looks like. As you say, too large a radius results in blurring and too small a radius results in aliasing.

I like to set sigma = 0.5 px, so that the overall radius is about 1.5 px (since the Gaussian has the majority of its weight within ±3 sigma of its mean). In my experience that gives a good trade-off between blurring and aliasing, but that's just my taste, not based on any objective considerations.

By the way, as part of [a blog post on antialiasing](http://www.reedbeta.com/blog/2014/11/15/antialiasing-to-splat-or-not/) I wrote last year (which was based on an answer I posted on the previous incarnation of this site!), I tested a variety of antialiasing kernels against a synthetic test image and came out with 0.5 px Gaussian as my subjective favorite.

> **Comments:**
> **username_0**: I remember that answer last time round :) (I was githubphagocyte back then). Interesting to see it expanded into a blog post.  

---

### Answer by username_1 on 2016-03-25. Score: 4

Imagine that one is rendering a picture of a flat floor with a uniform black and white checkerboard pattern that extends to the horizon; the checkers are large enough that they should be clearly visible at points near the camera but not large enough to be distinguishable near the horizon.

Near the horizon, the floor should simply appear as uniform gray. Near the camera, the checkers should appear distinct. Between the camera and the horizon the appearance of the floor must somehow transition between those two extremes.

If the scene is rendered a spacial filter that has a very sheep cut-off, there will be a certain distance where the floor goes from being checkered to being gray. If one uses a shallower filter, the transition will be much more gradual, but things near the original "cut-off" distance will be less sharp than they would have been otherwise.

If one were to add a "wall" or crop the scene to hide the distant parts of the floor, such that there was no need to have any parts of the checkered floor blurred to gray, the best results would be obtained by using the steepest filter, yielding the sharpest image. Using a shallower filter would give up image sharpness for the purpose of preventing a nasty transition that wasn't going to be visible anyway.

Figuring out what kind of filtering to use thus requires that one know something about the spacial frequency content of the information to be displayed. If the image contains nothing of interest that would approach Nyquist, using a steep filter will produce the sharpest results. If, however, image content exceeds Nyquist, using a gradual filter will avoid ugly "transitions". No single approach will be optimal for all cases.


---

### Answer by username_2 on 2015-08-05. Score: 2

In my opinion and experience i don't think there exists an univocal answer... since basically in literature you can easily find example of adaptive filters too (i.e. of variable size).

I think the actual answer should be related to the both context of applications (i.e. hardware or sofware, real time or not) and kind of scene you're going to synthesize (some scenes usually involves different kind of aliasing when are synthetized (i use this general term on purpose)). Basically computer graphics is the study of algorithms and data structure for image synthesis, and such definition isn't stricly related to any kind of application.

Of course an important factor is even the goal to be achieved by a filtering process (i.e. not necessary an excessive blurring could be bad...).

If you're speaking of "nice to see" i think you could agree with me when i say that there's no specific measure of "pleasant image".


---

