Logo by Fiery - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. March 28, 2024, 12:32:47 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1] 2   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: To anti-alias, or not to anti-alias? Hit the button or leave it alone?  (Read 6911 times)
Description: questions about antialiasing in general
0 Members and 1 Guest are viewing this topic.
chaos_crystal
Safarist
******
Posts: 98


I Have No Limits.


WWW
« on: December 13, 2012, 01:25:08 AM »

Hi all,  grin  it's been a long time since I posted here! I still use mainly 2D fractal programs such as Fractal Explorer, Sterling2, and Tiera-Zon. Haven't poked around with Mandelbulb 3D much, partly b/c of a stubborn computer that seems to be getting cranky in its "advancing" age (probably 6+ years I'm guessing, it was refurbished and reformatted in 2009 and I received it as a gift, so who knows) and takes years to render anything bigger than a fairly-large size 2D fractal scene.

Anyway, in learning a bit more about Sterling2, I read about how to antialias...that is, make the image 4x larger than the final version, hit 4:1 and supposedly, you have a buttery smooth perfect rendering....after waiting about half an hour...LOL. I find that if I have an image that has a ton of impossibly intricate detail and try this, I wind up with the fine details looking blurry, even though bigger simpler sections of the image might look great.

I have produced a good many fractals that sport jagged edges....even if they are looking spiffy otherwise. And I really do not mind seeing those color bands that could be blended by antialiasing... I just wish I knew the best way to get rid of the jaggies w/o losing the tiny details. There is a limit, apparently, but where to draw the line, so to speak? I am puzzled and a bit frustrated.  undecided

Here is a link to a site where a guy is thoroughly against antialiasing, it seems:

http://www.1up.com/do/blogEntry?publicUserId=6143216&bId=9098879

And yes, you can even see a good few of my latest efforts right here, at my website link...commentary and critiques are welcome!  - thanks :

http://wildwanderingirl.wordpress.com/
Logged

I conceived and developed a new geometry of nature and implemented its use in a number of diverse fields. It describes many of the irregular and fragmented patterns around us, and leads to full-fledged theories, by identifying a family of shapes I call fractals.

— Benoit Mandelbrot
Tglad
Fractal Molossus
**
Posts: 703


WWW
« Reply #1 on: December 13, 2012, 03:21:04 AM »

The guy in your link who is against anti-aliasing has defined it as blending with neighbouring pixels in the image. So he is actually criticising blurring, not anti-aliasing.
What you're doing is supersampling (which is a common method of antialiasing), and it actually adds detail to the image rather than taking it away. If you only have a certain number of pixels to work with then a more densely sampled average of the colour under each square pixel will always be more accurate.

There is an exception to this rule... if you are rendering details which have no area by definition, e.g. lines, points, fractals like Koch curve, menger carpet, Sierpinski triangle etc then the problem is that more supersampling just dilutes the pixels until you can't see the shape at all!
The best result would be to darken each pixel in proportion to the length of the line under the pixel in the case of lines, or the number of points under the pixel in the case of points.
In practice this can be done by counting the supersampled pixels under one pixel that contain the geometry and multiplying that figure by the supersample size to the power D. When we're rendering points D = 0, when we're rendering lines D = 1. This then generalises to other fractals by setting D to the fractal dimension of the fractal.

I have never seen anyone (including myself) ever actually try this form of antialiasing... but it should be the best way to show the details. Maybe you could be the first to try it!
« Last Edit: December 13, 2012, 04:36:39 AM by Tglad » Logged
chaos_crystal
Safarist
******
Posts: 98


I Have No Limits.


WWW
« Reply #2 on: December 13, 2012, 04:46:24 AM »

What you're doing is supersampling (which is a common method of antialiasing), and despite what you think it actually adds detail to the image rather than taking it away.

I remember hearing about 'supersampling' during my experiences with the program XnView. I kinda stopped using that (although it would be easy to get back) when someone told me simply saving my BMP files as PNG files would be a good solution to aiding picture quality. It certainly has helped with color quality, although, as mentioned, I am concerned about the jaggies.

Quote
There is an exception to this rule... if you are rendering details which have no area by definition, e.g. lines, points, fractals like Koch curve, menger carpet, Sierpinski triangle etc then the problem is that more supersampling just dilutes the pixels until you can't see the shape at all!

Right! You've seen fractals that have areas that look like tangled masses of steel wool or something? Sterlingware tends to turn out these complicated fractals. Of course zooming in brings out the nice details, but those tangled areas are still present on the scene and going into infinity. If you have a good image that contains those things, that is the part that gets blurry and, well, ugly.

Quote
The best result would be to darken each pixel in proportion to the length of the line under the pixel in the case of lines, or the number of points under the pixel in the case of points. In practice this can be done by counting the supersampled pixels under one pixel that contain the geometry and multiplying that figure by the supersample size to the power D. When we're rendering points D = 0, when we're rendering lines D = 1. This then generalises to other fractals by setting D to the fractal dimension of the fractal.

I have never seen anyone (including myself) ever actually try this form of antialiasing... but it should be the best way to show the details. Maybe you could be the first to try it!

I would be happy to give it a go....(always ready to try new things and be a trailblazer, as befits Aries!) if I knew enough about math to know how to go about it?

Here is a scientific PDF document that might explain this, to someone a lot smarter than me!

http://www.x86-secret.com/articles/divers/v5-6000/datasheets/FSAA.pdf
« Last Edit: December 14, 2012, 06:01:11 PM by chaos_crystal » Logged

I conceived and developed a new geometry of nature and implemented its use in a number of diverse fields. It describes many of the irregular and fragmented patterns around us, and leads to full-fledged theories, by identifying a family of shapes I call fractals.

— Benoit Mandelbrot
Tglad
Fractal Molossus
**
Posts: 703


WWW
« Reply #3 on: December 15, 2012, 02:08:20 AM »

I built the algorithm and it works really well:

The left image is black if any of the supersampled points is inside the Mandelbrot set- too jagged, no anti-aliasing
The right image averages the supersampled points- smooth but the lines at the top fade away, you can't even see the top area
The middle is the method I described- smooth on the smooth areas and you still see the full structure

I put it in a blog post- http://tglad.blogspot.com.au/2012/12/dimension-aware-rasterising.html
« Last Edit: September 13, 2017, 03:39:11 AM by Tglad » Logged
kram1032
Fractal Senior
******
Posts: 1863


« Reply #4 on: December 15, 2012, 05:11:17 PM »

Very interesting idea.
I wonder if it could be refined. Boxcounting might give directional bias, right? If you somehow could use circle-counting...
Though that would be much slower, I guess.
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #5 on: December 16, 2012, 12:24:35 AM »

Another way to bring out detail when rendering 2D fractals, is to use a distance estimator. For near-dust fractals this makes is possible to get quite good quality, where standard sampling would fail.

Here is an example with DE-rendering, which is difficult render for high iteration counts using standard sampling:



Parameters:
Iterations = 2000
Breakout radius = 10
JuliaX = -0.77896
JuliaY = 0.12536

Could you try your method for these settings?
Logged
Tglad
Fractal Molossus
**
Posts: 703


WWW
« Reply #6 on: December 16, 2012, 08:19:14 AM »

Nice image... how do you use the distance estimator... do you only do one sample per pixel? and what is your zoom level?

I think that DE is basically an approximation of supersampling, because it uses the distance to approximate how much of the surface under the pixel is inside the set.
For an image which is roughly the same fractal dimension everywhere (I think your image is an example of this) there wouldn't be a difference between current rendering methods and darkening using this new method. One would just be a multiple of the other.

The method is useful when there are parts of different dimensions in the same image, such as this one:
The first three rasterisers are appropriate for points, lines and surfaces respectively, and each work well for that geometry. The fourth is my method, it calculates the fractal dimension per pixel and renders appropriately. So you get anti-aliased lines and anti-aliased disk in the same pic.


* example1.png (33.45 KB, 1060x303 - viewed 473 times.)
« Last Edit: December 16, 2012, 01:03:52 PM by Tglad » Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #7 on: December 16, 2012, 08:26:17 PM »

I dont think DE-methods are similar to supersampling - for very light / zero area systems (like the one above), you are not likely to hit anything in the set by just doing point-sampling. But with a DE, you can add some width to the set. For instance, here is the system again, drawn with 16 samples per pixel, and colored if just one sample hits the set:



The above image was rendered with 700 iterations. With 2000 iterations it nearly disappears completely.


I find the distance like any ordinary 3D DE:
Code:
vec2 dz = vec2(1,0);
for (i = 0; i < Iterations; i++) {
dz = complexMul(z,dz)*2.0 + (Julia ? vec2(0.0) : vec2(1.0,0.0));
z = complexMul(z,z) + (Julia ? c2 : c);
if (dot(z,z)>100) break;
}

float r = length(z);
float de = r*log2(r)/length(dz);

And then consider a point to be part of the set, if closer than a treshold (that determines how dense the drawing will be - notice this is dependent on zoom factor). In the image in the previous post, I used 16 samples (chosen spherically around the pixel center, and weighted with a gaussian function).
Logged
Tglad
Fractal Molossus
**
Posts: 703


WWW
« Reply #8 on: December 17, 2012, 09:00:03 AM »

Yes point-sampling is bad, you want to 'pixel sample' i.e. see if the whole pixel contains the set. In my previous picture I was 'pixel sampling' rather than point sampling, otherwise the lines and points wouldn't have shown up at all.
DE is basically sampling a disk rather than a point, and the threshold specifies the disk radius.

So normal threshold would be half the supersample pixel size right? But if you make it half the actual pixel size then you get something similar to my method, since it will render thin lines and points anti-aliased without them fading out. Here's a comparison, the left uses my method and right is with half a pixel width added. You get fatter lines and the points are more blurred with the right image. Not a big difference, I'll compare a mandelbrot next.




* comparedToDE.png (39.4 KB, 1042x519 - viewed 451 times.)
« Last Edit: December 17, 2012, 12:02:35 PM by Tglad » Logged
Tglad
Fractal Molossus
**
Posts: 703


WWW
« Reply #9 on: December 17, 2012, 12:42:34 PM »

Here's a high res mandelbrot comparison with 16x16 supersampling.
The left uses DE threshold of 0.5*supersample pixel width, i.e. proper 16x16 supersampling. The tree parts fade out.
The middle is the method I described.
The right is using a DE threshold of 0.5*the pixel size, to get full darkness on even 1d lines. You can see it is a bit chunky so loses details.
(you have to download the image and zoom in to see the antialiasing)


* hires.png (50.3 KB, 793x289 - viewed 474 times.)
« Last Edit: December 17, 2012, 12:48:24 PM by Tglad » Logged
kram1032
Fractal Senior
******
Posts: 1863


« Reply #10 on: December 17, 2012, 01:28:14 PM »

TGlad, can you retry your experiment with the parameters Syntopia gave before?
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #11 on: December 17, 2012, 10:02:29 PM »

Yes point-sampling is bad, you want to 'pixel sample' i.e. see if the whole pixel contains the set. In my previous picture I was 'pixel sampling' rather than point sampling, otherwise the lines and points wouldn't have shown up at all.

How does this pixel sampling work? I guess you can do square/line intersections when drawing e.g. lines, but don't you need something like a DE to check if a given square area contains a point in a fractal set?

Logged
Tglad
Fractal Molossus
**
Posts: 703


WWW
« Reply #12 on: December 18, 2012, 12:27:34 AM »

Yes sorry I am using DE for fractals. Checking whether the set is within a radius is close enough to checking whether the set is inside the pixel (or sub pixel). The difference is only in how you choose a shade given the number of supersample pixels that contain the set.
Kram I'll give it a go but not sure how deep the zoom is...
Logged
kram1032
Fractal Senior
******
Posts: 1863


« Reply #13 on: December 18, 2012, 11:44:35 AM »

Well, it's approximately deep but not very deep. cheesy
Syntopia, could you clarify on that?
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #14 on: December 18, 2012, 09:26:53 PM »

Well, it's approximately deep but not very deep. cheesy
Syntopia, could you clarify on that?

The zoom? Not very far - one quarter size or so. The Fragmentarium params are:

Center = -0.0430245,0.319072
Zoom = 3.05902

I think Zoom = 1 would correspond to rendering (-1,-1) to (1,1) - at least if the viewport is square.
Logged
Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Anti-fractal? Non-Fractal related Chit-Chat heneganj 3 5456 Last post April 11, 2007, 04:40:58 PM
by bradorpoints
Anti-aliasing again Mandelbulber Ike1970 2 3567 Last post May 01, 2011, 06:20:40 PM
by Buddhi
How do I get anti-aliasing? Fragmentarium SCORPION 2 2506 Last post March 23, 2014, 03:50:22 AM
by SCORPION
3D Anti-buddhabrot Programming ker2x 7 3258 Last post July 29, 2014, 06:57:45 PM
by knighty
Anti-Gravity Antennae anti-attract an anti-gravity sphere Mandelbulber Gallery mclarekin 0 2303 Last post August 31, 2014, 01:15:13 AM
by mclarekin

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.244 seconds with 26 queries. (Pretty URLs adds 0.012s, 2q)