POV-Ray : Newsgroups : povray.binaries.images : How to avoid concentric rings with spot light on flat surface Server Time
4 May 2024 14:43:23 EDT (-0400)
  How to avoid concentric rings with spot light on flat surface (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: cbpypov
Subject: How to avoid concentric rings with spot light on flat surface
Date: 5 Nov 2017 16:30:01
Message: <web.59ff821ccef2753b8248f19d0@news.povray.org>
I am rendering an introduction scene for my photonic crystal animation in which
spot lights shine on a planar surface. As seen in the attachment, there are
these concentric rings. They are even worse because of jpeg chromatic noise.

How can I avoid these rings? Normally (e.g. in Photoshop), I'd just add some
Gaussian noise to blur the interfaces of the color values (which is there due to
the small color gradient). But somehow I could not find out how to add such a
"pixel" noise to the texture (and maybe it would be computationally
expensive!?).

Thanks!


Post a reply to this message


Attachments:
Download '20171103_scene01_001.jpg' (34 KB)

Preview of image '20171103_scene01_001.jpg'
20171103_scene01_001.jpg


 

From: clipka
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 5 Nov 2017 17:27:40
Message: <59ff905c$1@news.povray.org>
Am 05.11.2017 um 22:26 schrieb cbpypov:
> I am rendering an introduction scene for my photonic crystal animation in which
> spot lights shine on a planar surface. As seen in the attachment, there are
> these concentric rings. They are even worse because of jpeg chromatic noise.
> 
> How can I avoid these rings? Normally (e.g. in Photoshop), I'd just add some
> Gaussian noise to blur the interfaces of the color values (which is there due to
> the small color gradient). But somehow I could not find out how to add such a
> "pixel" noise to the texture (and maybe it would be computationally
> expensive!?).

Actualy, Photoshop's gaussian blur filter wouldn't help you here: This
is colour banding from colour quantization.

What you really need is dithering.

In POV-Ray v3.6 and earlier, this would have required output to a file
format with more bits per colour channel (e.g. 16-bit PNG) and
post-processing in some external piece of software.

As of v3.7, POV-Ray provides inbuilt dithering via the `+th`
command-line switch. By default this enables Floyd-Steinberg dithering,
but alternatives are also available. Most notably, `+thB4` activates 4x4
Bayer dithering, which may (*) be a better choice for animations.

(* or may not; I suggest trying both. Probably no need to bother with
the other alternatives though.)


Post a reply to this message

From: clipka
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 5 Nov 2017 17:36:52
Message: <59ff9284$1@news.povray.org>
Am 05.11.2017 um 23:27 schrieb clipka:
> Am 05.11.2017 um 22:26 schrieb cbpypov:
>> I am rendering an introduction scene for my photonic crystal animation in which
>> spot lights shine on a planar surface. As seen in the attachment, there are
>> these concentric rings. They are even worse because of jpeg chromatic noise.
>>
>> How can I avoid these rings? Normally (e.g. in Photoshop), I'd just add some
>> Gaussian noise to blur the interfaces of the color values (which is there due to
>> the small color gradient). But somehow I could not find out how to add such a
>> "pixel" noise to the texture (and maybe it would be computationally
>> expensive!?).
> 
> Actualy, Photoshop's gaussian blur filter wouldn't help you here: This
> is colour banding from colour quantization.
> 
> What you really need is dithering.
> 
> In POV-Ray v3.6 and earlier, this would have required output to a file
> format with more bits per colour channel (e.g. 16-bit PNG) and
> post-processing in some external piece of software.
> 
> As of v3.7, POV-Ray provides inbuilt dithering via the `+th`
> command-line switch. By default this enables Floyd-Steinberg dithering,
> but alternatives are also available. Most notably, `+thB4` activates 4x4
> Bayer dithering, which may (*) be a better choice for animations.
> 
> (* or may not; I suggest trying both. Probably no need to bother with
> the other alternatives though.)

As a side note, the `+th` switch also enables dithering for the preview
window, but the algorithm used there may differ from the one used in
file output.


Post a reply to this message

From: cbpypov
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 6 Nov 2017 04:55:00
Message: <web.5a0030723541f8ac80db62550@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> >
> > How can I avoid these rings? Normally (e.g. in Photoshop), I'd just add some
> > **Gaussian noise** to blur the interfaces of the color values (which is there
>
> Actualy, Photoshop's gaussian blur filter wouldn't help you here: This
> is colour banding from colour quantization.
>
> What you really need is dithering.

I wrote **Gaussian noise** (see above), not _blur_ ... and from what Wikipedia
says about dithering:

    "Dither is an intentionally applied form of noise used to randomize
    quantization error, preventing large-scale patterns such as color
    banding in images.",

it seems to be almost exactly that ;) Somehow I had not stumbled upon when
dithering is used before, but I am not easily fooled when it comes to Photoshop
:) If you apply Gaussian noise -> Color noise reduction -> Gaussian blur (in
this order) even the Jpeg looks good.

>
> As of v3.7, POV-Ray provides inbuilt dithering via the `+th`
> command-line switch. By default this enables Floyd-Steinberg dithering,
> but alternatives are also available. Most notably, `+thB4` activates 4x4
> Bayer dithering, which may (*) be a better choice for animations.
>

However, the dithering works great, as you suggested. BUT, only if PNG output
format is used (JPEG stays almost unchanged!), and only using the
Floyd-Steinberg. The Bayer dithering even increases the problem! Unfortunately,
the Floyd-version increases the PNG file size to 1.2 MB per frame in Full HD. So
it will be quite large if I render 5 minutes at 30 frames/s ;) But I'm fine with
it...

Thank you very much :)


Post a reply to this message

From: clipka
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 6 Nov 2017 08:08:15
Message: <5a005ebf@news.povray.org>
Am 05.11.2017 um 23:36 schrieb clipka:
> As a side note, the `+th` switch also enables dithering for the preview
> window, but the algorithm used there may differ from the one used in
> file output.

Just noticed that I have to correct myself: Preview is always dithered.


Post a reply to this message

From: cbpypov
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 6 Nov 2017 08:30:03
Message: <web.5a0062da3541f8ac80db62550@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 05.11.2017 um 23:36 schrieb clipka:
> > As a side note, the `+th` switch also enables dithering for the preview
> > window, but the algorithm used there may differ from the one used in
> > file output.
>
> Just noticed that I have to correct myself: Preview is always dithered.

Yes, I noticed that.

And I have to correct myself to: the dithering is fine, but when rendering the
MP4 the effect comes back again (to a limited extent, though). Moreover, it
ruins text rendering :( So this would enforce to render the text separately,
which I don't want to do. So obviously I have to find a different solution.
Maybe I'll just change the intro scene to not show the flat silicon...

See the attachment for a short example.


Post a reply to this message


Attachments:
Download 'phc_movie_midq.mp4.mpg' (3730 KB)

From: clipka
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 6 Nov 2017 09:12:27
Message: <5a006dcb$1@news.povray.org>
Am 06.11.2017 um 10:50 schrieb cbpypov:

> However, the dithering works great, as you suggested. BUT, only if PNG output
> format is used (JPEG stays almost unchanged!), and only using the
> Floyd-Steinberg. The Bayer dithering even increases the problem! Unfortunately,
> the Floyd-version increases the PNG file size to 1.2 MB per frame in Full HD. So
> it will be quite large if I render 5 minutes at 30 frames/s ;) But I'm fine with
> it...

Well, without dithering you do have less entropy in the image, so it can
be compressed more strongly without loss.

As for not giving an advantage with JPEG, that's intentional: Dithering
is high-frequency low-amplitude noise, which is exactly the type of
signal JPEG compression tends to throw away. With POV-Ray's standard
JPEG quality settings you wouldn't see a difference between an image
that had dithering applied and an image that didn't. You'd need
top-quality settings, at which image size probably wouldn't differ much
from a PNG. Therefore, JPEG output currently doesn't support dithering
at all (though I might change that).

Please elaborate why you say the Bayer dithering "increases" the
problem. In my own experiments I do still see concentric artifacts (*),
but IMO they're less obvious than without dithering.


(*) My guess is that this is due to gamma issues. I knew this could
theoretically be a problem, but I never thought it would be noticeable
at 8 bits per colour channel. I did already work around this issue for
the dithering algorithms based on error diffusion (such as
Floyd-Steinberg) because it was comparatively easy to solve there, but I
guess it would be quite difficult to adapt a purely pattern-based
algorithm (such as Bayer) to be equally "gamma-neutral" (except for the
special case where output is 1 bit per colour channel).


Post a reply to this message

From: clipka
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 6 Nov 2017 09:18:56
Message: <5a006f50$1@news.povray.org>
Am 06.11.2017 um 15:12 schrieb clipka:
> As for not giving an advantage with JPEG, that's intentional: Dithering
> is high-frequency low-amplitude noise, which is exactly the type of
> signal JPEG compression tends to throw away. With POV-Ray's standard
> JPEG quality settings you wouldn't see a difference between an image
> that had dithering applied and an image that didn't. You'd need
> top-quality settings, at which image size probably wouldn't differ much
> from a PNG. Therefore, JPEG output currently doesn't support dithering
> at all (though I might change that).

As another side note, I guess passing the image data to the JPEG library
at a higher bit depth might also be able to work around the colour
banding, without requiring increased JPEG quality settings. However,
this would require compiling a custom version of the JPEG library; also,
the banding might be re-introduced later in the toolchain, depending on
viewing / post-processing software.


Post a reply to this message

From: clipka
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 6 Nov 2017 11:59:15
Message: <5a0094e3@news.povray.org>
Am 06.11.2017 um 14:25 schrieb cbpypov:

> And I have to correct myself to: the dithering is fine, but when rendering the
> MP4 the effect comes back again (to a limited extent, though).

Yes, mpeg tends to do that, for precisely the same reason as jpeg.

> Moreover, it ruins text rendering :(

Dithering or mp4?
How so?


Post a reply to this message

From: cbpypov
Subject: Re: How to avoid concentric rings with spot light on flat surface
Date: 6 Nov 2017 14:55:00
Message: <web.5a00bd373541f8ac80db62550@news.povray.org>
I'll try to give you a substantiated answer tomorrow ... sorry I can't manage
today.


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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