A Complete Guide to Web Design

(やまだぃちぅ) #1
Transparency 275

GIF

Transparency

Web Design in a Nutshell, eMatter Edition

Making transparent areas visible again


In a limited way, you can use the Alpha Channel information to reverse transpar-
ency as well; however, once image information is erased, you can never truly get
it back again. When you change pixels in the Alpha Channel from black (trans-
parent) back to white (visible), what appears is the Transparency Index Color, not
the area’s original color.


So for instance, in the graphic used in the previous example, once I scribble
through my name in the graphic, it can never be restored to its original state just
by “undoing” the transparency (i.e., erasing the black pixels in the alpha channel).
Instead of being transparent, the areas appear in the default Transparency Index
Color, as shown in Figure 14-6.


In spite of the crudeness of the above example, when planned properly the Alpha
Channel can be used to remove unwanted transparency from pixels within an
image (an alternative to the “Creating a distinct color for transparency” technique
discussed earlier).


For this example, consider an image that has a white background but also white
text. The goal is to turn the white pixels around the image transparent but to keep
the white text visible. Simply making white transparent turns the white text trans-
parent as well, as shown in Figure 14-7.


Figure 14-6: Restoring alpha channel does not restore original image


Figure 14-7: All white areas turn transparent when white background is selected as
transparent


Restored alpha channel
does not restore image.
Free download pdf