Saturday, 7 April 2018

terminology - What is Aliasing and Anti-Aliasing?


What is Aliasing and Anti-Aliasing? Is it a bad thing to have in an image? If so how to avoid it?


If you can describe your answer using examples then that would be great.



Answer




Aliasing means quite a few different things. They're all generally related (effects from digital sampling) but in different situations, it takes considerably different forms. For example, even though they're both digital graphics, what you see with a digital camera is considerably different than what you see in computer generated graphics (and both are entirely different from aliasing in digital audio).


The kind of aliasing you deal with in digital photography happens when detail in the image, when projected onto the sensor is roughly the same size or smaller than a single pixel in the sensor.


This can lead to Moire patterns and false color in the image. Just for example, let's assume there was an extremely fine white line across the image. If its width (as projected on the sensor) is smaller than the width of a sensor well, then it will show up as the color(s) of the sensor wells it happens to be projected on, rather than the actual color of the light. Even though it contains (we'll assume) exactly equal amounts of red, green, and blue, its small size prevents it from affecting all three colors of sensors equally, so it only shows up as the colors of the sensor wells it happens to strike.


Moire patterns (another artifact of aliasing) happen from interference between detail in the subject matter, and the grid of the sensor. This one is pretty easy to show:


enter image description here


The diagonal "stripe" patterns are from interference between the grid of the LCD I was taking a picture of, and the grid of the sensor wells in the camera. When I look at the screen, I don't see anything like that, but when taking a picture of the screen with a digital camera, it's hard to avoid.


Though most people don't take pictures of LCD screens a lot, other subjects with fine detail can as well, especially if it follows a grid-like pattern. Cloth, for one example, is notorious for causing problems, especially with cameras that don't have antialiasing filters.


As far as what you do it about it, you use an antialiasing filter. An antialiasing filter is basically just a low-pass filter, that limits the frequency you sample to something below the "Nyquist limit" for the sampling you're doing. In the case of a digital camera, that's a few sheets of glass almost directly in front of the sensor, that blur the image ever so slightly. The intent is to ensure that the finest dot of light projected on the sensor will cover at one complete red/green/blue sensor group.


As you can probably guess, this is a bit of a balancing game. If you blur the image too much, customers will be unhappy because the images aren't "sharp". If you blur it too little, they'll be unhappy because of aliasing artifacts. In most cases, you can get aliasing artifacts in extreme cases (e.g., the camera I used to take the picture above has an AA filter), and of course people still wish the pictures were sharper.


In a few cases (e.g., Nikon D800 vs. D800E) they've simply let the customer pick their poison, so to speak. To an extent, you get the same choice between typical DLSRs (most have AA filters) and medium format cameras (most don't).



I should add that without an AA filter, aliasing can lead to "false detail" -- what looks like extremely fine detail in the image, but is really just a sampling artifact. This can give a result that looks impressively sharp -- but some of that detail has almost no basis in reality at all.


No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...