POV-Ray : Newsgroups : povray.binaries.images : Testing/Using Gaussian Blur Inc File : Re: Testing/Using Gaussian Blur Inc File Server Time
28 Nov 2023 18:51:12 EST (-0500)
  Re: Testing/Using Gaussian Blur Inc File  
From: kurtz le pirate
Date: 13 Nov 2023 04:26:55
Message: <6551ebdf$1@news.povray.org>
On 13/11/2023 08:32, Dave Blandston wrote:
> Howdy Folks,
> I'm experimenting with the blur effect commonly seen bordering social media
> images. I contemplated writing the code to perform a Gaussian blur which seemed
> simple enough until I got to the part about edge handling. Well, sure enough Tor
> Olav Kristensen has already done the hard work and made a Gaussian blur include
> file for POV so I'm trying it out. As I anticipated, the level of mathematical
> and algorithmic sophistication in this file is far beyond my humble abilities so
> I'm unable to modify it to get the results I hoped for. Fortunately this is just
> a for-fun project so I'm giving up pretty easily. However, I'm curious if anyone
> has experience using this file and knows what's going on in the attached image.
> The top picture shows desired results that I made with a paint program. The
> middle picture shows the POV version. The green background seems to show through
> around the edges. I changed all the filter and transmit values to 0 in Tor's
> file but the background still shows through. The bottom picture just shows the
> POV version again with a background of White * -1, which gave the best results
> but still not quite what I was looking for.
> Have a great day everyone!
> Kind regards,
> Dave Blandston


I don't think you quite understand how TOK did it (granted, it's not
easy). In fact, the key is in the SelectRectangleFn function and in the

For the function, the return value (0 or 1) is juste a value which will
be used in the texture_map.

The texture_map say that "0" is mapped to ImagePigment and for "1"
mapped to BlurredImagePigmentGy.

Having said that, I modified TOK's "Blur_Image_Region.pov" file :

#declare SelectRectangleFn = function {
	*select(x - 0.25*Width, 0, 1)
	*select(x - 0.75*Width, 1, 0)
	*select(y - 0.00*Height, 0, 1)
	*select(y - 1.00*Height, 1, 0)

In x direction 0 to 200 and 600 to 800
In y direction 0 to 600.

and now it's time to modify the "texture_map"

texture_map {
//	[ 0.0 pigment { color Yellow } ]
	[ 0.0 BlurredImagePigmentGy ]
	[ 1.0 ImagePigment ]

Which gives the attached image.

Hope that help.

Kurtz le pirate
Compagnie de la Banquise

Post a reply to this message

Download 'blur_image_region-2.jpg' (30 KB)

Preview of image 'blur_image_region-2.jpg'


Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.