POV-Ray : Newsgroups : povray.binaries.images : Testing/Using Gaussian Blur Inc File Server Time
27 Apr 2024 05:37:23 EDT (-0400)
  Testing/Using Gaussian Blur Inc File (Message 1 to 3 of 3)  
From: Dave Blandston
Subject: Testing/Using Gaussian Blur Inc File
Date: 13 Nov 2023 02:35:00
Message: <web.6551d108845b180df9e40ba69334df62@news.povray.org>
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


Post a reply to this message


Attachments:
Download 'thumbnail demo.jpg' (238 KB)

Preview of image 'thumbnail demo.jpg'
thumbnail demo.jpg


 

From: kurtz le pirate
Subject: Re: Testing/Using Gaussian Blur Inc File
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
> 

Hello.

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
texture_map.

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 {
	1
	*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


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

Preview of image 'blur_image_region-2.jpg'
blur_image_region-2.jpg


 

From: Dave Blandston
Subject: Re: Testing/Using Gaussian Blur Inc File
Date: 13 Nov 2023 13:30:00
Message: <web.65526abba3d4d985f9e40ba69334df62@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> Hello.
>
> 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
> texture_map.
>
> 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 {
>  1
>  *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



OK awesome I can use that now. What a great tool Tor Olav Kristensen has given
us! Thanks for helping me out with that!

Kind regards,
Dave Blandston


Post a reply to this message

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