图像处理 抗锯齿放大_什么是抗锯齿,它如何影响我的照片和图像?
图像处理 抗锯齿放大
Anti-aliasing is a word that’s often thrown around by photographers and gamers when dealing with graphics and images. Take a look at what anti-aliasing is, why we use it, and, most importantly, when it’s best to not use it.
消除锯齿是摄影师和游戏玩家在处理图形和图像时经常抛出的一个单词。 看看什么是抗锯齿,为什么要使用它,最重要的是,什么时候最好不使用它。
It’s an important part of imagemaking and photography—anti-aliasing is certainly something that should be understood as thoroughly as possible to create high quality images. We hope you’re prepared for a very geeky article, as you have lots of discussion of math and science mixed in with today’s explainer article. Keep reading!
这是成像和摄影的重要部分-抗锯齿当然应该被透彻理解,以创建高质量的图像。 我们希望您已经准备好撰写一篇令人讨厌的文章,因为今天的解释文章中充斥着对数学和科学的讨论。 继续阅读!
向量和像素,以及相机为何用像素拍照 (Vectors and Pixels, and Why Cameras Take Pictures With Pixels)
()
You may remember an article from a year ago where we talked about the difference in Vectors and Pixels. There are a number of fundamental differences between the two: pixels are ordered arrays of light, pigment, or color; vectors are mathematical representations of lines, shapes, gradients, etc. Vectors are precise; they exist at absolute coordinates on an algebraic grid. Because they are so absolute, there’s no blurring the line between where they are and where they are not. Even if a monitor cannot render a line segment’s infinite thinness (it always has to show it in pixels), it still is as thin as a line existing only in a theoretical mathematical world.
您可能还记得一年前的一篇文章,其中谈到了Vectors和Pixels的区别 。 两者之间有许多基本区别:像素是光,颜料或颜色的有序数组; 向量是直线,形状,渐变等的数学表示。 它们存在于代数网格上的绝对坐标上。 因为它们是如此的绝对,所以在它们存在与不存在之间的界限不会模糊。 即使监视器无法渲染线段的无限细度(它总是必须以像素显示),它仍然像仅在理论数学世界中存在的线一样细。
That’s the problem with photography—light isn’t as precise as it would need to be to be captured in a perfectly mathematical way. It’s likely that even if we developed cameras capable of reading the locations of individual photons with quantum precision as they hit the sensor, because of the weird nature of physics at the quantum level, the individual particles may actually appear in multiple places on the sensor at the same time. This means it may be absolutely impossible to get the absolute location of that single particle of light at the time it hit the sensor—photography is only an approximation of how that light is captured. The stopping action (ability of the camera to create sharp images from moving objects) can never be perfect—at least it seems very, very unlikely.
这就是摄影的问题-光线并没有以完全数学方式捕获的精确度高。 即使我们开发了能够在单个光子撞击传感器时以量子精度读取其位置的照相机,由于量子级物理学的怪异性质 ,单个粒子实际上可能会出现在传感器上的多个位置。同时。 这意味着在它到达传感器时,绝对不可能获得该单个粒子的绝对位置-摄影只是该光的捕获方式的近似值。 停止动作(相机从移动的物体生成清晰图像的能力)永远不可能是完美的-至少看起来非常非常不可能。
Pixels are handy because high-resolution images can approximate colors and shapes, accurately recreating an image in a way that is similar to film-based photography. While this property of pixels and its use in photography is not anti-aliasing exactly, understanding this property of digital photography is one of the best places to start a solid understanding of what anti-aliasing is.
像素很方便,因为高分辨率图像可以近似颜色和形状,从而以与基于胶片的摄影类似的方式准确地重建图像。 尽管像素的这种特性及其在摄影中的使用并非 完全抗锯齿,但了解数字摄影的这一特性是开始深入了解什么是抗锯齿的最佳场所之一。
插值:从(几乎)什么都不会创造出什么? (Interpolation: Creating Something From (Almost) Nothing?)
Digital photography is an approximation of the colors and values present when light hits a sensor—in this same way, anti-aliasing is an approximation of image data using a technique called “Interpolation.” Interpolation is a fancy-pants math term meaning data created based on the trends of existing data, i.e. an educated guess on what might actually be in that spot if more data points were available. While it is more complicated that simple guessing—there are formulas and proper methods for Interpolation—it can’t be expected to be a perfectly accurate representation of the image data that is actually there. Even the smartest math can’t create something from nothing.
数码摄影是光线照射到传感器时所呈现的颜色和值的近似值;以同样的方式,抗锯齿是使用称为“ 插值 ”的技术对图像数据的近似值。 插值是一种花哨的数学术语,表示根据现有数据趋势创建的数据,即,如果有更多数据点可用,则可以对那个点上实际存在的东西进行有根据的猜测。 尽管简单的猜测(有一些公式和适当的插值方法)更为复杂,但不能指望它是实际存在的图像数据的完美精确表示。 即使是最聪明的数学也无法一无所获。
When we look at these computer rendered checkerboards, we can begin to understand what anti-aliasing is doing to improve and approximate images. On the leftmost image, there’s no interpolation of data—the checkerboard is rendered in black and white pixels as it recedes back in perspective, and quickly becomes a mess. The visual errors and artifacts created are what we call “aliasing.” The second and third images above use different forms of “anti-aliasing” to better approximate how human eyes (and cameras) perceive light.
当我们看这些计算机渲染的棋盘时,我们可以开始了解抗锯齿在改善和近似图像方面的作用。 在最左边的图像上,没有数据插值-棋盘以黑白像素渲染,因为它在透视中后退,并很快变得一团糟。 所产生的视觉错误和伪影就是我们所说的“锯齿”。 上面的第二张和第三张图像使用不同形式的“抗锯齿”以更好地估计人眼(和相机)如何感知光。
Those images, however, were a translation of absolute mathematical images into pixel based images. How does anti-aliasing apply to your photography? When images are resized, either enlarged or reduced, the image is interpolated based on the data that exist in the image document. The left image is shrunk using the “nearest neighbor” resampling in Photoshop—in other words, it isn’t anti-aliased (you can literally call this aliased). The image on the right is reduced and anti-aliased, creating a much truer image at that small size.
但是,这些图像是将绝对数学图像转换为基于像素的图像。 抗锯齿如何应用于您的摄影? 调整图像大小(放大或缩小)时,将根据图像文档中存在的数据对图像进行插值。 使用Photoshop中的“最近邻居”重采样缩小左图像,换句话说,它没有抗锯齿(您可以称其为别名 )。 右侧的图像会被缩小和抗锯齿,从而以较小的尺寸创建更真实的图像。
Enlarged images also benefit from anti-aliasing—graphics programs make their best guess based on the data in your image. Keep in mind when you are upsampling (enlarging) images in a graphics program, that you will never actually get more resolution out of a digital enlargement—the kind of interpolation being done can make a good guess as to what should be there, but it’ll never know for sure. Your edges will be soft, and get softer as the photo gets enlarged more and more.
放大的图像还可以受益于抗锯齿功能-图形程序会根据图像中的数据做出最佳猜测。 在图形程序中对图像进行升采样(放大)时,请记住,您实际上永远不会从数字放大中获得更高的分辨率 -进行的插值方式可以很好地猜测应该存在的内容,但是永远无法确定。 您的边缘会变柔和,并且随着照片越来越大而变得越来越柔和。
A good rule of thumb is that you can always downsample (shrink) your images without loss of quality from anti-aliasing. Upsampling (enlarging) makes the anti-aliasing very obvious, adds no new resolution, and should only be done if it can’t be avoided.
一条好的经验法则是,您始终可以对图像进行降采样(缩小),而不会因抗锯齿而降低质量。 上采样(放大)使抗锯齿非常明显,没有增加新的分辨率,只有在无法避免的情况下才应这样做。
抗锯齿和矢量:抗锯齿为何使视频游戏看起来更好 (Anti-Aliasing and Vectors: Why Anti-Aliasing Makes Videogames Look Better)
If you’ve played a PC game in the past 15 or so years, you might have seen video options that included settings for anti-aliasing. If you remember when we discussed vector shapes existing in an absolute position, you should begin to understand why anti-aliasing is important to video games.
如果您在过去15年左右的时间里玩过PC游戏,则可能已经看到了包含抗锯齿设置的视频选项。 如果您记得当我们讨论绝对位置上存在的矢量形状时,您应该开始理解为什么抗锯齿对于视频游戏很重要。
3 Dimensional forms are created in vector polygons, and these polygons exist in a math only realm. Anti-aliasing in video games has at least two goals: firstly it wants to be able to render the absolute, hard-edged lines of the polygons in a form that looks decent on a pixel-based monitor; secondly, anti-aliasing better replicates the imprecise way that photography and human eyes perceive light.
3在矢量多边形中创建尺寸形式 ,并且这些多边形存在于仅数学领域中。 视频游戏中的抗锯齿至少有两个目标:首先,它希望能够以一种在基于像素的监视器上看起来不错的形式来渲染多边形的绝对硬边线。 其次,抗锯齿可以更好地复制摄影和人眼感知光线的不精确方式。
抗锯齿和排版 (Anti-Aliasing and Typography)
On a final note, there are plenty of occasions where anti-aliasing is not ideal. If you’ve ever worked around graphic designers, you’re likely to have heard them complain about typography in Photoshop, and how inferior it is to Illustrator—and they’re right.
最后,在很多情况下抗锯齿效果都不理想。 如果您曾经在平面设计师附近工作过,您可能会听说他们抱怨Photoshop中的版式,以及它对Illustrator的影响如何,而且他们是对的。
Both of the letters above are pixel based typography, with the left one being aliased, the right one anti-aliased. Neither are good representations of typography, or at least that typeface. It is acceptable to render a font on screen with anti-aliasing, but for print, it can have some disastrous consequences.
上面的两个字母都是基于像素的字体,左边的是别名,右边的是抗锯齿。 字体或字体至少都不能很好地表现出来。 在屏幕上使用抗锯齿渲染字体是可以接受的,但是对于打印,可能会带来一些灾难性的后果。
When you think about what letters are, they don’t really follow the same rules that digital photography requires. Letters are abstract ideas and absolute shapes—they fall better into the “pure math” category of vector artwork. And depending on the type of printing process used to create them, those pure math vector shapes become absolutely important.
当您考虑字母是什么时,它们并没有真正遵循数码摄影所需的规则。 字母是抽象的概念和绝对的形状,它们更好地属于矢量艺术品的“纯数学”类别。 而且,取决于用于创建它们的打印过程的类型,这些纯数学矢量形状变得绝对重要。
This image above was created with anti-aliased type, and then most likely offset printed. When we look closely we can see why that’s bad.
上面的这张图片是使用抗锯齿类型创建的,然后很可能是胶版印刷的。 当我们仔细观察时,可以看到为什么这样不好。
It becomes clear very quickly that these anti-aliased forms did not hold up well when printed this way. This is an example of how anti-aliasing (as well as pixel-based imaging) can be inferior when rendering typography.
很快就很清楚,以这种方式打印时,这些抗锯齿的表格效果不佳。 这是在渲染字体时抗锯齿(以及基于像素的成像)效果较差的一个示例。
Of course, had this been an image (like a photograph) and not the abstract forms of type, it would have held up quite well.
当然,如果这是图像(如照片)而不是抽象类型的形式,它会很好地保持住。
Type, being an abstract medium, requires the precision of vectors to hold up under the kinds of printing processes that don’t use inkjet dots to create an image. Even at very close distances, we don’t see any dots or evidence that anti-aliasing that went into the files used to print this Coke can.
作为一种抽象媒介,类型要求矢量的精度在不使用喷墨点创建图像的打印过程中才能保持。 即使距离很近,我们也看不到任何点或证据表明用于打印此可乐的文件中的抗锯齿效果可以。
Of course, most HTG readers won’t be offset printing most of their photos, so pixel-based typography printed from dot-based printers will work out just fine. Simply be aware of your anti-aliasing when you’re working with typography and when you’re working with photography—you’ll find you’re better prepared to make the right choices that will give you the best possible images.
当然,大多数HTG阅读器都不会胶印大部分照片,因此从基于点的打印机打印的基于像素的版式效果很好。 在使用版式和摄影时,只需注意您的抗锯齿功能即可,您会发现自己已做好充分的准备,可以做出正确的选择,从而为您提供最佳的图像。
If you have any questions regarding anti-aliasing and your photographs you feel we haven’t answered, or maybe you think we’ve left something important out, feel free to let us know about it in the comments below.
如果您对抗锯齿和您的照片有任何疑问,您觉得我们没有回答,或者您认为我们遗漏了一些重要的内容,请随时在下面的评论中告诉我们。
Image credits: Varena #1 by hasensaft, available under Creative Commons. Blurred umbrella portrait by Shannon, available under Creative Commons. Dragon Age 2 Demo Ogre VH by Deborah Timmins, available under Creative Commons. Anti-Aliasing Images by Loisel, available under GNU Free License.
图片鸣谢: hasensaft的 Varena#1 ,可在“ 创用CC”下找到 。 香农(Shannon)的 雨伞肖像模糊 ,可在 创用CC(Commons Commons)下获得 。 龙腾世纪2演示食人魔VH由 黛博拉·蒂明斯 ,可根据 知识共享 。 Loisel 的抗锯齿图像 ,可根据 GNU Free License获得 。
翻译自: https://www.howtogeek.com/73704/what-is-anti-aliasing-and-how-does-it-affect-my-photos-and-images/
图像处理 抗锯齿放大