In graphics, a portion of each pixel's data that is reserved for
transparency information. 32-bit graphics systems contain four channels
-- three 8-bit channels for red, green, and blue (RGB) and one 8-bit
alpha channel. The alpha channel is really a mask -- it specifies how
the pixel's colors should be merged with another pixel when the two are
overlaid, one on top of the other.
Typically, you wouldn't
define the alpha channel on a pixel-by-pixel basis, but rather per
object. Different parts of the object would have different levels of
transparency depending on how much you wanted the background to show
through. This allows you to create rectangular objects that appear as
if they are irregular in shape -- you define the rectangular edges as
transparent so that the background shows through. This is especially
important for animation, where the background changes from one frame to
the next.
Rendering overlapping objects that include an alpha value is called alpha blending.
----------------------------------------------------
有關通道的教程很多,也有許多講解如何應用Alpha通道的文章。但比較深入地講解Alpha通道的幾乎沒有看到。
PS中開啟一幅圖片(以.jpg為例),就會自動產生三個通道:紅、綠、藍通道。這三個通道叫色彩通道。
在圖片上做個選區,然後用:選擇/儲存選區命令,把選區儲存起來。
這時,你進入通道面板,會發現多出來一個通道。這就是Alpha通道。
看來,Alpha通道的功能就是用來“儲存選區”的。那麼Alpha通道“儲存選區”,是用的什麼手段來實現的呢?
許多人會想,Alpha通道是記錄下“選區的位置資訊”,來儲存選區的。但是,這個理解是片面的。
Alpha通道不僅要用記錄選區的位置資訊,還要記錄選區像素的“透明度”來儲存選區的。有點抽象是吧?但事實如此。
Alpha通道確實給人有點看不見、摸不著的感覺。因為它的作用手段很特別。
我們在圖片上,用選取工具,羽化20,做個選區,儲存選區,然後再看Alpha通道,你會發現Alpha通道圖發生了變化。為什嗎?因為選區被羽化了的關係。
做
選區時用羽化的目的,是為了“暈化”選區邊緣。如果Alpha通道只記錄選區的位置資訊,那怎麼來實現“暈化”的作用呢?而要實現“暈化”所用的機制是:
根據操作者的設定,自動在Alpha通道圖上,產生一個作用圖。這個作用圖,用灰階值0-255共256級分別與0%-100%(透明度)對應。透明度
100%時(對應255灰,白色)表示該像素完全顯示,透明度0%時(對應0灰,黑色)表示該像素完全不顯示,其他透明度1%-99%時將按比例地進行“
比例透明顯示”。沒有羽化時,作用圖上只有 225白和0黑。這個作用圖,就是Alpha通道所記載的“透明度”資訊。
你在圖片的Alpha通道上執行:選擇/載入選區命令後,然後在圖層,Ctrl+J,你將會在新圖層上看到一個邊緣被羽化的圖象。
所以你在建立的Alpha通道圖上,可以用畫筆,用255白色塗抹需要的地區,用0黑色塗抹不需要的地區,用不同灰階的灰色塗抹需要部分透明的地區。透明的程度全由你所選灰色的灰階來決定。
你在圖片的Alpha通道上執行:選擇/載入選區命令後,然後在圖層,Ctrl+J,你將會在新圖層上看到,你按透明度的原理設計出的Alpha通道圖所有的表現。
理解這個原理後,你就會認識,Alpha通道並不難理解。