POV-Ray : Newsgroups : povray.binaries.images : Anti-Aliasing Problem including sample image (58k) Server Time
14 Aug 2024 09:18:11 EDT (-0400)
  Anti-Aliasing Problem including sample image (58k) (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: Rene Schwietzke
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 03:57:19
Message: <3de488ef@news.povray.org>
Hi,

Your are right. I just checked Irfanview and PSP. I know ImageMagick but I
use it very seldom. I will check it.

Thanks
Rene

--
Rene Schwietzke
r.schwietzke<at>reneschwietzke.de
http://www.rene-schwietzke.de/

> Thats not completely true. Photoshop uses internal the CIE L*a*b color
> format for all image processing and does avoid that unwanted color
blending.
> L*a*b is also a possible color format for TIFF images but most image
> viewers (like IrfanView) do not display this format correctly, maybe thats
the
> reason that not so many people know about it.
> For high quality images, it's the best to render them without AA but twice
the
> size and then use P'shop to downsample them. See the attached (3x
magnified)
> examples. One is just POV with +AA0.0 +AM2, the other one is resampled
> with Photoshop. If I remember right, ImageMagic works fine with CIE L*a*b,
> so maybe it could also be used, but I have not checked this out.


Post a reply to this message

From: Rene Schwietzke
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 03:58:50
Message: <3de4894a@news.povray.org>
Thanks. I will give it a try today.

Rene
--
Rene Schwietzke
r.schwietzke<at>reneschwietzke.de
http://www.rene-schwietzke.de/

"Anders K." <and### [at] kaseorgcom> wrote in message
news:3de42b38$1@news.povray.org...
> I wrote:
> > The problem completely goes away when I gamma-correct your image by 2.2.
> > Don't tell me that old anti-aliasing gamma bug snuck back in there...
>
> I just checked, and indeed, POV-Ray seems to be antialiasing after gamma
> correction. Bad!! This should really be fixed, but as a workaround, you
can
> render with Display_Gamma=1.0 and then manually gamma-correct the image by
> 2.2.


Post a reply to this message

From: Christoph Hormann
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 04:19:56
Message: <3DE48E3B.A056E319@gmx.de>
Rene Schwietzke wrote:
> 
> [...]
> 
> Does anyone know a way to suppress this strange but quite logical behavior?
> Would it make sense to use an averaging algorithm based on HSL instead of
> RGB to improve the results? Of course, it could also be a problem without
> any solution. Comments are welcome.

The reason is that color blending in POV is based on linear interpolation
between the different color values in RGB space.  Although HSL color space
is somewhat different i don't think it would solve the problem.  

I think it would be an interesting feature to add an optional different
(and more realistic) color interpolation method to POV-Ray, not only for
antialiasing but also for color maps for example.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 15 Nov. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Rene Schwietzke
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 04:33:01
Message: <3de4914d$1@news.povray.org>
Hi Christoph,

I checked the code and saw the linear interpolation algorithm. Therefore I
expected an unsolvable problem but the discussion above shows, that it might
be a defect. Could LAB solve the problem as discussed before? It seems to be
fine for Photoshop but it could be protected by copyrights...

Rene
--
Rene Schwietzke
r.schwietzke<at>reneschwietzke.de
http://www.rene-schwietzke.de/

"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3DE48E3B.A056E319@gmx.de...

> The reason is that color blending in POV is based on linear interpolation
> between the different color values in RGB space.  Although HSL color space
> is somewhat different i don't think it would solve the problem.
>
> I think it would be an interesting feature to add an optional different
> (and more realistic) color interpolation method to POV-Ray, not only for
> antialiasing but also for color maps for example.
>
> Christoph


Post a reply to this message

From: Christoph Hormann
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 05:00:53
Message: <3DE497D5.5B052B6B@gmx.de>
Rene Schwietzke wrote:
> 
> Hi Christoph,
> 
> I checked the code and saw the linear interpolation algorithm. Therefore I
> expected an unsolvable problem but the discussion above shows, that it might
> be a defect. Could LAB solve the problem as discussed before? It seems to be
> fine for Photoshop but it could be protected by copyrights...

Doing color interpolation in CIE color space could indeed help but
conversion isn't easy.  A google search for 'CIE color interpolation' or
something similar will spit out a lot of material.  It might be easier
though to simply implement some nonlinear interpolation in RGB space
instead, this could be easily adjusted too.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 15 Nov. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Rene Schwietzke
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 05:25:47
Message: <3de49dab$1@news.povray.org>
Hi,

the ImageMagick (http://www.imagemagick.org) source can be accessed...a way
to borrow a few ideas?

Rene

--
Rene Schwietzke
r.schwietzke<at>reneschwietzke.de
http://www.rene-schwietzke.de/
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3DE497D5.5B052B6B@gmx.de...
>
> Doing color interpolation in CIE color space could indeed help but
> conversion isn't easy.  A google search for 'CIE color interpolation' or
> something similar will spit out a lot of material.  It might be easier
> though to simply implement some nonlinear interpolation in RGB space
> instead, this could be easily adjusted too.
>


Post a reply to this message

From: Ive
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 07:12:48
Message: <3de4b6c0$1@news.povray.org>
> I just checked, and indeed, POV-Ray seems to be antialiasing after gamma
> correction. Bad!! This should really be fixed, but as a workaround, you can
> render with Display_Gamma=1.0 and then manually gamma-correct the image by
> 2.2.
>

Strange. I've checked it and it seems to work, but I do not understand why.
From my knowledge, simple color blending within the RGB color space
should always give that unwanted result, and I do not see what gamma
correction has to do with it. Can somebody please enlighten me.

-Ive


Post a reply to this message

From: Anders K 
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 11:22:13
Message: <3de4f135@news.povray.org>
Ive wrote:
> Strange. I've checked it and it seems to work, but I do not understand
why.
> From my knowledge, simple color blending within the RGB color space
> should always give that unwanted result, and I do not see what gamma
> correction has to do with it. Can somebody please enlighten me.

Suppose we're just "antialiasing" two pixels together, purple and cyan --
that is, rgb <1, 0, 1> and rgb <0, 1, 1>. If we antialias and then
gamma-correct, we get <0.730, 0.730, 1> which the monitor turns into <0.500,
0.500, 1>, the color halfway between purple and cyan. However, if we
gamma-correct and then antialias (as POV-Ray does), we get <0.500, 0.500, 1>
which the monitor turns into about <0.218, 0.218, 1> -- resulting in the
blue line.

Anders

P.S. Here's the original image gamma-corrected by 2.2. As you can see, the
unwanted colors are gone.

--
light_source{6#local D=#macro B(E)#macro A(D)#declare E=(E-#declare
C=mod(E D);C)/D;C#end#while(E)#if(A(8)=7)#declare D=D+2.8;#else#if(
C>2)}torus{1..2clipped_by{box{-2y}}rotate<1 0C>*90translate<D+1A(2)
*2+1#else}cylinder{0(C-v=1).2translate<D+C*A(2)A(4)#end-2 13>finish
{specular 1}pigment{rgb x}#end#end#end-8;1B(445000298)B(519053970)B
(483402386)B(1445571258)B(77778740)B(541684549)B(42677491)B(70)}


Post a reply to this message


Attachments:
Download 'aa-sample.png' (56 KB)

Preview of image 'aa-sample.png'
aa-sample.png


 

From: Ive
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 13:05:30
Message: <3de5096a@news.povray.org>
> Suppose we're just "antialiasing" two pixels together, purple and cyan --
> that is, rgb <1, 0, 1> and rgb <0, 1, 1>. If we antialias and then
> gamma-correct, we get <0.730, 0.730, 1> which the monitor turns into <0.500,
> 0.500, 1>, the color halfway between purple and cyan. However, if we
> gamma-correct and then antialias (as POV-Ray does), we get <0.500, 0.500, 1>
> which the monitor turns into about <0.218, 0.218, 1> -- resulting in the
> blue line.
>

Well, I already got it by thinking a little more about the problem (as always
first thinking then posting) but anyway thanks a lot.

-Ive


Post a reply to this message

From: Anders K 
Subject: Re: Anti-Aliasing Problem including sample image (58k)
Date: 27 Nov 2002 13:48:19
Message: <3de51373$1@news.povray.org>
I posted a patch for this problem in povray.programming.

Subject: Apply gamma correction after antialiasing
<http://news.povray.org/3de5126d$1@news.povray.org>

For this patch to work, make sure you set global_settings { assumed_gamma
1.0 } in your scene.

Anders

--
light_source{6#local D=#macro B(E)#macro A(D)#declare E=(E-#declare
C=mod(E D);C)/D;C#end#while(E)#if(A(8)=7)#declare D=D+2.8;#else#if(
C>2)}torus{1..2clipped_by{box{-2y}}rotate<1 0C>*90translate<D+1A(2)
*2+1#else}cylinder{0(C-v=1).2translate<D+C*A(2)A(4)#end-2 13>finish
{specular 1}pigment{rgb x}#end#end#end-8;1B(445000298)B(519053970)B
(483402386)B(1445571258)B(77778740)B(541684549)B(42677491)B(70)}


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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