Title: anti-aliasing comparisons (super sampling) Post by: billtavis on May 01, 2016, 11:37:53 PM This post was inspired by this thread: http://www.fractalforums.com/images-showcase-%28rate-my-fractal%29/supersonic/15/
The topic is anti-aliasing your fractals by downsizing the image. So I decided to come up with what I would consider to be the absolute worst case for aliasing: slowly moving, slightly diagonal color bands that get closer and closer together until they are far thinner than a single pixel. I used a smooth exponential function to generate the tests instead of a fractal - my reason is simple: this way we can be sure that any noise present is from aliasing and not the function itself. So here's what it looks like with no anti-aliasing. As the lines get closer together, there's horrible crawling stair-stepping which turns into a distracting moire pattern: (http://i288.photobucket.com/albums/ll174/BillTavis/testAA_noAA_zps2pduwznk.gif) Here's the result of rendering it 4x bigger, followed by downsizing the image using bicubic sampling. I did this in code, but this is the equivalent of simply opening the image in photo-editing software and scaling it down. The result has improved, but the crawling stairsteps and moire pattern are still very pronounced: (http://i288.photobucket.com/albums/ll174/BillTavis/testAA_4xcubic_zpswchfdsin.gif) Here I have added a Gaussian blur prior to downsizing. I blurred it with a sigma of 2 (half of the upres amount). The result is much better! The first one is bicubic, and the second one is downsized using Lanczos filtering. Lanczos downsizing is available in both Gimp and Krita and is also what Flickr uses to create thumbnails. The difference is very subtle between the two, but in my opinion the crawling on the Lanczos diagonals is slightly better. Still, both have noticeable moire patterns. (http://i288.photobucket.com/albums/ll174/BillTavis/testAA_4xcubicBlur_zpsgnikwbgi.gif) (http://i288.photobucket.com/albums/ll174/BillTavis/testAA_4x_zpswip16jox.gif) Here I rendered it 6x bigger, blurred it by 3, and downsized with Lanczos. This is what I would consider to be the first acceptable result... but there is still a slight bit of noise in the gray area on the left: (http://i288.photobucket.com/albums/ll174/BillTavis/testAA_6x_zpsoexchagb.gif) Here I went up to 12x bigger, blurred by 6, and downsized with Lanczos. The noise is better in the gray, but the difference is so slight I'm not sure it justifies the extra time/memory needed to do it. It's the law of diminishing returns. It's also worth noting that there is still a small amount of visible crawling on the diagonals - it's simply impossible to get rid of that entirely due to the nature of pixels: (http://i288.photobucket.com/albums/ll174/BillTavis/testAA_12x_zpss3cpwjen.gif) Title: Re: anti-aliasing comparisons (super sampling) Post by: billtavis on May 01, 2016, 11:42:20 PM I rendered two larger still images to see the difference between 6x and 12x. If you look, there is still a strip of Moire pattern on the bottom left of the 6x picture. These patterns were still visible at 10x. 12x was the smallest amount of downsizing to remove them completely... but remember that this is an absolute worst case scenario. In my opinion, usually 6x or even 4x is plenty when combined with a blur.
6x: (http://i288.photobucket.com/albums/ll174/BillTavis/testAA_6xBig_zpsijq4rsfa.png) 12x: (http://i288.photobucket.com/albums/ll174/BillTavis/testAA_12xBig_zpslqcm5dcb.png) Title: Re: anti-aliasing comparisons (super sampling) Post by: quaz0r on May 02, 2016, 04:39:18 PM interesting experiment, well done :) |