POV-Ray : Newsgroups : povray.pov4.discussion.general : Basic blur : Re: Basic blur Server Time27 Feb 2024 18:27:01 EST (-0500)
 Re: Basic blur
 From: Bald Eagle Date: 21 Jan 2019 10:10:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5c45dffae22651a8765e06870%40news.povray.org",
"headline": "Re: Basic blur",
"dateCreated": "2019-01-21T15:10:00+00:00",
"datePublished": "2019-01-21T15:10:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
"IGM" <iar### [at] gmailcom> wrote:

> Is there a way to apply a basic blur to the image without external apps, to
> avoid the unrealistic sharpness of objects in the focal plane?

This is one of the things I was exploring with the Fourier transform.

Apparently "ALL" graphics packages accomplish many of their tasks using the
results of a 2D FFT.

Mathematically, applying a Gaussian blur to an image is the same as convolving
the image with a Gaussian function. This is also known as a two-dimensional
Weierstrass transform. By contrast, convolving by a circle (i.e., a circular box
blur) would more accurately reproduce the bokeh effect. Since the Fourier
transform of a Gaussian is another Gaussian, applying a Gaussian blur has the
effect of reducing the image's high-frequency components; a Gaussian blur is
thus a low pass filter.

So, you might be able to use that info for something, or come up with some other
clever method to fake it.

Things that come to mind are:

a thin clear sheet or lens in between the scene and the camera with an IOR > 1
a plane with some sort of AOI
a sheet or plane with a normal function

Taking a peek at:
https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1

you might be able to do what folks do to create a Voronoi diagram - use cones to
fill a space.
So, what I envision is "scanning" the rendered image with eval_pigment() and
placing a semi-transparent cone every 3rd POV unit to a achieve a blurring
effect
Perhaps add a function for the z-position so that the cones are higher the
farther away from the focal center.

Maybe something with concentric circles.

Obviously the clear sheet/lens would give you the smoothest result.
The rest are just things people might be inspired to fiddle with to create some
interesting and perhaps unexpected artistic effects.
```